Skip to content

Commit

Permalink
chore: Improve Integration Test Matrix (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Sep 22, 2023
1 parent 97eb0a7 commit fdc73d4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,42 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [16.x]
node-version:
- ${{ vars.DEFAULT_NODE_VERSION }}
vscode-version: [stable]
include:
- os: ubuntu-latest
node-version: ${{ vars.DEFAULT_NODE_VERSION }}
vscode-version: package.json
- os: ubuntu-latest
node-version: ${{ vars.DEFAULT_NODE_VERSION }}
vscode-version: insiders

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm i
- run: npm run build
- run: xvfb-run -a npm run test-client-integration

- name: Install and Build
run: |
npm i
npm run build
- name: Run Linux
if: runner.os == 'Linux'
- run: npm run test-client-integration
env:
VSCODE_VERSION: ${{ matrix.vscode-version }}
run: xvfb-run -a npm run test-client-integration

- name: Run Windows and MacOS
if: runner.os != 'Linux'
env:
VSCODE_VERSION: ${{ matrix.vscode-version }}
run: npm run test-client-integration
# cspell:ignore xvfb
14 changes: 11 additions & 3 deletions packages/_integrationTests/src/runTests.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ async function run(version: undefined | 'stable' | 'insiders' | string) {
await runTests(options);
}

async function getVSCodeVersionFromPackage(): Promise<string> {
const extPkg = JSON.parse(await fs.readFile(path.join(extensionDevelopmentPath, 'package.json'), 'utf8'));
return extPkg.engines['vscode'].replace('^', '');
}

async function main() {
try {
const extPkg = JSON.parse(await fs.readFile(path.join(extensionDevelopmentPath, 'package.json'), 'utf8'));
await run('stable');
await run(extPkg.engines['vscode'].replace('^', ''));
const versions = process.env['VSCODE_VERSION'] ? [process.env['VSCODE_VERSION']] : ['stable', 'package.json'];
for (const version of versions) {
const vscVersion = version === 'package.json' ? await getVSCodeVersionFromPackage() : version;
console.log('Versions: %o', { version, vscVersion });
await run(vscVersion);
}
} catch (err) {
console.error(err);
console.error('Failed to run tests');
Expand Down

0 comments on commit fdc73d4

Please sign in to comment.