File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,15 +35,20 @@ jobs:
3535 if : github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
3636 run : sudo apt-get install -y xvfb
3737
38+ - name : Get VS Code version from package.json
39+ if : github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
40+ id : vscode-ver
41+ run : |
42+ VERSION=$(node -p 'require("./apps/vscode-e2e/package.json").devDependencies["@types/vscode"]')
43+ echo "version=$VERSION" >> $GITHUB_OUTPUT
44+
3845 - name : Cache VS Code test binary
3946 if : github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
4047 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
4148 with :
4249 path : |
4350 apps/vscode-e2e/.vscode-test/
44- key : vscode-test-${{ runner.os }}-1.100.0-v1
45- restore-keys : |
46- vscode-test-${{ runner.os }}-1.100.0-
51+ key : vscode-test-${{ runner.os }}-${{ steps.vscode-ver.outputs.version }}-v1
4752
4853 - name : Run mocked E2E tests
4954 id : run-e2e
Original file line number Diff line number Diff line change 11import * as path from "path"
22import * as os from "os"
33import * as fs from "fs/promises"
4+ import { readFileSync } from "fs"
45
56import { runTests } from "@vscode/test-electron"
67import { LLMock } from "@copilotkit/aimock"
@@ -156,12 +157,16 @@ async function main() {
156157 }
157158
158159 // Download VS Code, unzip it and run the integration test
160+ // Read VS Code version from package.json to keep in sync with @types /vscode
161+ const pkg = JSON . parse ( readFileSync ( path . resolve ( __dirname , "../package.json" ) , "utf-8" ) )
162+ const vscodeVersion = process . env . VSCODE_VERSION || pkg . devDependencies [ "@types/vscode" ]
163+
159164 await runTests ( {
160165 extensionDevelopmentPath,
161166 extensionTestsPath,
162167 launchArgs : [ testWorkspace ] ,
163168 extensionTestsEnv,
164- version : process . env . VSCODE_VERSION || "1.100.0" ,
169+ version : vscodeVersion ,
165170 } )
166171 } catch ( error ) {
167172 console . error ( "Failed to run tests" , error )
You can’t perform that action at this time.
0 commit comments