-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: run e2e tests on vsc release #7190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR refactors E2E test workflows by extracting common logic into reusable components. The changes improve maintainability and reduce duplication between main and PR workflows. However, there are several issues with the YAML syntax and potential workflow configuration problems that need to be addressed.
💡 To request a new detailed review, comment @continue-detailed-review
.github/workflows/e2e-tests.yml
Outdated
@@ -0,0 +1,58 @@ | |||
name: 'E2E Tests' | |||
description: 'Reusable workflow for running VS Code E2E tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 'description' field - it's not valid at the workflow level. Use 'name' only for workflow identification.
uses: actions/upload-artifact@v4 | ||
with: | ||
name: vscode-extension-build-Linux | ||
path: extensions/vscode/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline at end of file. Add a newline character to follow YAML best practices.
command: ${{ matrix.command }} | ||
ssh_key: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }} | ||
ssh_host: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }} | ||
is_fork: ${{ inputs.is_fork }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline at end of file. Add a newline character to follow YAML best practices.
npm run e2e:compile | ||
if [[ "${{ inputs.is_fork }}" == "true" ]]; then | ||
# Exclude SSH tests for forks | ||
FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using 'shopt -s nullglob' before the ls command to handle the case when no test files match the pattern, preventing potential errors.
# Include all tests for non-forks | ||
FILES=$(ls -1 e2e/_output/tests/*.test.js | jq -R . | jq -s .) | ||
fi | ||
echo "test_file_matrix<<EOF" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using heredoc syntax for GitHub outputs can be problematic with JSON. Consider using a single line: echo "test_file_matrix=$FILES" >> $GITHUB_OUTPUT
is_fork: ${{ inputs.is_fork }} | ||
|
||
vscode-e2e-tests: | ||
name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback 'unknown' for matrix.test_file suggests potential issues. Consider adding validation to ensure test_file_matrix is properly populated.
@@ -135,10 +136,23 @@ jobs: | |||
token: ${{ secrets.CI_GITHUB_TOKEN }} | |||
repository: continuedev/continue | |||
|
|||
vscode-e2e-tests: | |||
needs: check_release_name | |||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding 'if: always()' or 'if: success()' to clarify when E2E tests should run in the main workflow.
run: | | ||
node ./scripts/build-packages.js | ||
cd extensions/vscode | ||
npm ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling: 'npm ci || exit 1' to ensure the workflow fails properly if npm install fails.
echo "EOF" >> $GITHUB_OUTPUT | ||
env: | ||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 | ||
GITHUB_TOKEN: ${{ inputs.ci-github-token }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment explaining why CI_GITHUB_TOKEN is used here instead of the regular github-token input.
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }} | ||
uses: ./.github/workflows/e2e-tests.yml | ||
with: | ||
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good refactoring! Consider adding a comment explaining that SSH tests are excluded for forks in the reusable workflow.
Code Review Summary✅ Strengths
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic analysis
4 issues found across 4 files • Review in cubic
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
.github/workflows/e2e-tests.yml
Outdated
@@ -0,0 +1,58 @@ | |||
name: 'E2E Tests' | |||
description: 'Reusable workflow for running VS Code E2E tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the top-level 'description' key; it is not a valid workflow property and will cause workflow syntax validation errors
Prompt for AI agents
Address the following comment on .github/workflows/e2e-tests.yml at line 2:
<comment>Remove the top-level 'description' key; it is not a valid workflow property and will cause workflow syntax validation errors</comment>
<file context>
@@ -0,0 +1,58 @@
+name: 'E2E Tests'
+description: 'Reusable workflow for running VS Code E2E tests'
+
+on:
</file context>
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }} | ||
uses: ./.github/workflows/e2e-tests.yml | ||
with: | ||
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this workflow runs on a push event (where the pull_request payload is absent), the expression throws because github.event.pull_request is undefined. Guard the access with a check on github.event_name first to avoid runtime evaluation errors.
Prompt for AI agents
Address the following comment on .github/workflows/pr-checks.yaml at line 198:
<comment>If this workflow runs on a push event (where the pull_request payload is absent), the expression throws because github.event.pull_request is undefined. Guard the access with a check on github.event_name first to avoid runtime evaluation errors.</comment>
<file context>
@@ -192,112 +192,15 @@ jobs:
AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
- vscode-get-test-file-matrix:
- runs-on: ubuntu-latest
- outputs:
- test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
- steps:
- - uses: actions/checkout@v5
</file context>
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }} | |
is_fork: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true) || github.actor == 'dependabot[bot]' }} |
ssh_key: | ||
description: 'SSH key for SSH tests' | ||
required: false | ||
ssh_host: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Input ssh_host is declared but not used anywhere in the action; unused inputs make the contract misleading and add maintenance overhead.
Prompt for AI agents
Address the following comment on .github/actions/run-vscode-e2e-tests/action.yml at line 13:
<comment>Input ssh_host is declared but not used anywhere in the action; unused inputs make the contract misleading and add maintenance overhead.</comment>
<file context>
@@ -0,0 +1,99 @@
+name: 'Run VS Code E2E Tests'
+description: 'Runs VS Code E2E tests with test matrix generation and execution'
+inputs:
+ github-token:
+ description: 'GitHub token for accessing private repositories'
+ required: true
+ ci-github-token:
+ description: 'CI GitHub token for accessing private repositories'
+ required: true
</file context>
npm run e2e:compile | ||
if [[ "${{ inputs.is_fork }}" == "true" ]]; then | ||
# Exclude SSH tests for forks | ||
FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the glob e2e/_output/tests/*.test.js matches no files, ls exits with a non-zero status and the whole composite step fails even though an empty test set would be acceptable. Redirecting the error or using a safer file discovery method avoids false negatives.
Prompt for AI agents
Address the following comment on .github/actions/run-vscode-e2e-tests/action.yml at line 68:
<comment>If the glob e2e/_output/tests/*.test.js matches no files, ls exits with a non-zero status and the whole composite step fails even though an empty test set would be acceptable. Redirecting the error or using a safer file discovery method avoids false negatives.</comment>
<file context>
@@ -0,0 +1,99 @@
+name: 'Run VS Code E2E Tests'
+description: 'Runs VS Code E2E tests with test matrix generation and execution'
+inputs:
+ github-token:
+ description: 'GitHub token for accessing private repositories'
+ required: true
+ ci-github-token:
+ description: 'CI GitHub token for accessing private repositories'
+ required: true
</file context>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will increase confidence in main releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the tests are failing to run: https://github.com/continuedev/continue/actions/runs/17064326036
Summary by cubic
Run VS Code E2E tests in the release workflow and add a reusable E2E workflow + composite action to remove duplicated CI logic. Releases are now validated by the same test matrix used in PRs.
New Features
Refactors