Skip to content

Commit 0f65671

Browse files
Add smoke tests to GH Action (#9964)
* Update branch name (for testing) * TypeScript tests * python unit tests * ipython unit tests * single, multi, debugger tests * functional tests * Comment out VSIX build+upload when testing the action * Cache out/ directory * rename step id to more specific pythonFiles * single workspace tests * multi workspace tests * debugger tests * Add todo for when the PR is ready for review * Fix out/ cache key * Fix pythonFiles cache key * Retry single workspace tests * Use same cache key everywhere * Try out multi workspace tests * Try out debugger tests * Uncomment compile + upload step * run venv tests * Update branch name to trigger workflow * Adding comments + enable full test suite * Finalize versions of python we want to use * Try 3.7 instead of 3.8 * Run the workflow only on upstream master * Clean up comments * Revert to 3.8 * Update .github/workflows/ci.yml Co-Authored-By: Brett Cannon <[email protected]> * Apply suggestions from code review Co-Authored-By: Brett Cannon <[email protected]> * Rename test suite matrix key * Try bang operator * Make python cache keys more specific * Move repo condition up * Run a subset of tests to see if stuff still works * Update the branch to test the workflow * Try leaving no space between ! and the expression * Undo ! testing * Update pythonFiles cache key * Smoke tests * Don't install vsce globally * Where my env var value at * well this one didn't work * Use correct env var syntax * Remove curly brackets * Use xvfb for smoke tests * Take prep work outside of xvfb step * Uncomment things * Comment things out for testing * Merge master, fix things * forgot to comment condition * Uncomment testing checks * Newlines * Whitespaces #2 * Run tests on windows * Remember to package the Python files * Update build number earlier * Use existing VSIX artifact instead of repackaging * Skip repo condition for a test run * List directory content (debug) * Update ci.yml * Update ci.yml * Undo download artifact changes to compare * Re-add brackets * Force update build nb on bash shell * Do not call gulp:cleanExceptTests 😒 * Download artifact in place * Only run npx tsc -p ./ * Comment windows for now, re-run all prep (comparison) * Correct path for artifact download * Extract vsix from download location * Remove path when downloading * Cleanup now that the smoke tests run * Remove repo conditions (ready to be merged) * Newline * Don't need the python files in smoke tests * Ready for re-review * npm ci --prefer-offline Co-authored-by: Brett Cannon <[email protected]>
1 parent d2725aa commit 0f65671

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ jobs:
161161
- name: Clean directory
162162
run: npm run clean
163163

164+
# Use the GITHUB_RUN_ID environment variable to update the build number.
165+
# GITHUB_RUN_ID is a unique number for each run within a repository.
166+
# This number does not change if you re-run the workflow run.
167+
- name: Update build number
168+
run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID
169+
164170
- name: Package the VSIX
165171
run: npm run package
166172

@@ -180,7 +186,7 @@ jobs:
180186
matrix:
181187
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
182188
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
183-
os: [ubuntu-latest]
189+
os: [ubuntu-latest, windows-latest]
184190
# Run the tests on the oldest and most recent versions of Python.
185191
python: [2.7, 3.8]
186192
test-suite: [ts-unit, python-unit, venv, single-workspace, multi-workspace, debugger, functional]
@@ -346,3 +352,49 @@ jobs:
346352
- name: Run functional tests
347353
run: npm run test:functional
348354
if: matrix.test-suite == 'functional'
355+
356+
smoke-tests:
357+
name: Smoke tests
358+
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
359+
runs-on: ${{ matrix.os }}
360+
needs: [build-vsix]
361+
if: github.repository == 'microsoft/vscode-python'
362+
strategy:
363+
matrix:
364+
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
365+
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
366+
os: [ubuntu-latest, windows-latest]
367+
python: [3.8]
368+
steps:
369+
- name: Checkout
370+
uses: actions/checkout@v2
371+
372+
- name: Retrieve cached npm files
373+
uses: actions/cache@v1
374+
with:
375+
path: ~/.npm
376+
key: ${{runner.os}}-${{env.CACHE_NPM_DEPS}}-${{hashFiles('package-lock.json')}}
377+
378+
- name: Install dependencies (npm ci)
379+
run: npm ci --prefer-offline
380+
381+
- name: Download VSIX
382+
uses: actions/download-artifact@v1
383+
with:
384+
name: ${{env.ARTIFACT_NAME_VSIX}}
385+
386+
# Extract the artifact from its download folder (./${{env.ARTIFACT_NAME_VSIX}}) to the repo root,
387+
# then delete the download folder and compile the source code.
388+
- name: Prepare for smoke tests
389+
run: |
390+
mv ${{env.ARTIFACT_NAME_VSIX}}/* .
391+
rm -r ${{env.ARTIFACT_NAME_VSIX}}
392+
npx tsc -p ./
393+
shell: bash
394+
395+
- name: Run smoke tests
396+
env:
397+
DISPLAY: 10
398+
uses: GabrielBB/[email protected]
399+
with:
400+
run: node ./out/test/smokeTest.js

0 commit comments

Comments
 (0)