From 4c232974bad66b377e59c1708efebdf1a0ddb4ff Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Tue, 26 Sep 2023 18:48:45 +0200 Subject: [PATCH] chore: test the generated .vsix file. (#2838) --- .github/workflows/integration-test.yml | 44 ++++++++++++++++++++++++++ packages/_integrationTests/README.md | 5 +++ 2 files changed, 49 insertions(+) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 9cc547bc75..ec04d99578 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -53,4 +53,48 @@ jobs: env: VSCODE_VERSION: ${{ matrix.vscode-version }} run: npm run test-client-integration + + run-integration-tests-vsix: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + node-version: + - ${{ vars.DEFAULT_NODE_VERSION }} + vscode-version: [stable] + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v3.8.1 + with: + node-version: ${{ matrix.node-version }} + cache: npm + + - name: Install + run: | + npm i + + - name: Build .vsix file + run: npm run test-vsce-build + + - name: Build files for testing + run: npm run build + + - name: Run Linux + if: runner.os == 'Linux' + env: + VSCODE_VERSION: ${{ matrix.vscode-version }} + VSIX_LOCATION: ./temp/code-spell-checker.vsix + run: xvfb-run -a npm run test-client-integration + + - name: Run Windows and MacOS + if: runner.os != 'Linux' + env: + VSCODE_VERSION: ${{ matrix.vscode-version }} + VSIX_LOCATION: ./temp/code-spell-checker.vsix + run: npm run test-client-integration # cspell:ignore xvfb diff --git a/packages/_integrationTests/README.md b/packages/_integrationTests/README.md index f19e0737c8..f53401638d 100644 --- a/packages/_integrationTests/README.md +++ b/packages/_integrationTests/README.md @@ -12,3 +12,8 @@ Could not identify extension for 'vscode' require call from ... ``` These are cause because we are running the test runner from a different copy of vscode than the one use by the extension. It can be safely ignored. + +## Environment Variables + +- `VSIX_LOCATION` - tell the test runner to use a pre-made .vsix file. +- `VSCODE_VERSION` - tell the test runner which version of vscode to download.