test: add install tests for vs code extension VSCODE-703#1188
Closed
test: add install tests for vs code extension VSCODE-703#1188
Conversation
Earlier snyk was never scanning the vscode project because of the combination of project auto-detection and the presence of .vscode-test folder which contains several directories with package.json files. This commit disables the auto-detection so that snyk run tests on the current project. Additionally the current project was having a problem with a package declaring optional dependencies. These optional dependencies were platform specific so for any platform, all the optional dependencies will never be installed, only the ones that are platform compatible. Snyk requires what is declared in package-lock.json to be also present in node_modules folder which is why it would've failed. In the same commit, we added a pre and post test hook to remove the identified problematic optional dependencies from package-lock file before running the test and then restore it when the test is finished.
Earlier we were running check, build and tests on each OS in our matrix which did not allow us to test whether a build on ubuntu would work fine on Windows / MacOS or not. With this commit we are re-organising to check and build once on ubuntu and use the final artifact later in the test job to run tests against. Accordingly the test-and-build-from-fork and draft-release workflows have been modified to adapt the same change.
…ll-tests' into VSCODE-703-add-install-tests-for-VSCode-extension
…-add-install-tests-for-VSCode-extension
…-add-install-tests-for-VSCode-extension
gagik
reviewed
Dec 10, 2025
Comment on lines
+29
to
+36
| SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_DEV }} | ||
| ARTIFACTORY_HOST: ${{ secrets.ARTIFACTORY_HOST }} | ||
| ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
| ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
| GARASIGN_PASSWORD: ${{ secrets.GARASIGN_PASSWORD }} | ||
| GARASIGN_USERNAME: ${{ secrets.GARASIGN_USERNAME }} | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} |
Contributor
There was a problem hiding this comment.
these should be optional for fork
workflow should skip steps when not set
Comment on lines
+141
to
+165
| - name: Run Snyk Test | ||
| shell: bash | ||
| env: | ||
| SNYK_TOKEN: ${{ inputs.SNYK_TOKEN }} | ||
| run: | | ||
| pnpm run snyk-test | ||
|
|
||
| - name: Create Jira Tickets | ||
| if: > | ||
| ( | ||
| github.event_name == 'push' && github.ref == 'refs/heads/main' || | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event_name == 'schedule' | ||
| ) | ||
| shell: bash | ||
| env: | ||
| JIRA_API_TOKEN: ${{ inputs.JIRA_API_TOKEN }} | ||
| JIRA_BASE_URL: "https://jira.mongodb.org" | ||
| JIRA_PROJECT: "VSCODE" | ||
| JIRA_VULNERABILITY_BUILD_INFO: "- [GitHub Run|https://github.com/mongodb-js/vscode/actions/runs/${{github.run_id}}/jobs/${{github.job}}]" | ||
| run: | | ||
| pnpm run create-vulnerability-tickets > /dev/null | ||
|
|
||
| - name: Generate Vulnerability Report (Fail on >= High) | ||
| continue-on-error: ${{ github.event_name == 'pull_request' }} |
Contributor
There was a problem hiding this comment.
end of this file should match the new main:
vscode/.github/workflows/actions/test-and-build/action.yaml
Lines 122 to 158 in 6bce80a
gagik
reviewed
Dec 10, 2025
| @@ -1,3 +1,7 @@ | |||
| # Run manually to prepare a draft release for the next version of the extension. | |||
Contributor
There was a problem hiding this comment.
I think this file should be left unchanged
Contributor
|
Continued in #1235 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes