Skip to content

Commit

Permalink
Add scheduled test run against VSCode insiders (#7784)
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet authored Nov 14, 2024
2 parents 4584981 + 366a898 commit 490b6aa
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
24 changes: 22 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@ pr:
- main
paths:
exclude:
- ./*.md
- ./*.md

# Run a scheduled build every night on main to run tests against insiders VSCode.
# The variable testVSCodeVersion is set to insiders based on the build reason.
schedules:
- cron: "0 0 * * *"
displayName: Daily Insiders Build
branches:
include:
- main

variables:
defaultDotnetVersion: '8.0.403'
- name: defaultDotnetVersion
value: '8.0.403'
- name: testVSCodeVersion
${{ if eq( variables['Build.Reason'], 'Schedule' ) }}:
value: insiders
${{ else }}:
value: stable

stages:
- template: azure-pipelines/build-all.yml
Expand All @@ -36,6 +51,7 @@ stages:
parameters:
# Prefer the dotnet from the container.
dotnetVersion: ''
testVSCodeVersion: $(testVSCodeVersion)
installAdditionalLinuxDependencies: true
pool:
name: NetCore-Public
Expand All @@ -50,6 +66,7 @@ stages:
parameters:
# Prefer the dotnet from the container.
dotnetVersion: ''
testVSCodeVersion: $(testVSCodeVersion)
installAdditionalLinuxDependencies: true
pool:
name: NetCore-Public
Expand All @@ -63,6 +80,7 @@ stages:
- template: azure-pipelines/test-matrix.yml
parameters:
dotnetVersion: $(defaultDotnetVersion)
testVSCodeVersion: $(testVSCodeVersion)
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-windows-2022-open
Expand All @@ -74,6 +92,7 @@ stages:
- template: azure-pipelines/test-matrix.yml
parameters:
dotnetVersion: $(defaultDotnetVersion)
testVSCodeVersion: $(testVSCodeVersion)
pool:
name: Azure Pipelines
vmImage: macOS-13
Expand All @@ -96,3 +115,4 @@ stages:
- template: azure-pipelines/test-omnisharp.yml
parameters:
dotnetVersion: $(defaultDotnetVersion)
testVSCodeVersion: $(testVSCodeVersion)
5 changes: 4 additions & 1 deletion azure-pipelines/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ parameters:
- name: installAdditionalLinuxDependencies
type: boolean
default: false
- name: testVSCodeVersion
type: string

jobs:
- job:
Expand All @@ -26,4 +28,5 @@ jobs:
parameters:
dotnetVersion: ${{ parameters.dotnetVersion }}
installAdditionalLinuxDependencies: true
npmCommand: $(npmCommand)
npmCommand: $(npmCommand)
testVSCodeVersion: ${{ parameters.testVSCodeVersion }}
3 changes: 3 additions & 0 deletions azure-pipelines/test-omnisharp.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
parameters:
- name: dotnetVersion
type: string
- name: testVSCodeVersion
type: string

steps:
- checkout: self
Expand All @@ -19,6 +21,7 @@ steps:
displayName: 🧪 Run unit and integration tests
env:
DISPLAY: :99.0
CODE_VERSION: ${{ parameters.testVSCodeVersion }}

- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ parameters:
default: false
- name: npmCommand
type: string
- name: testVSCodeVersion
type: string

steps:
- checkout: self
Expand All @@ -29,6 +31,7 @@ steps:
displayName: 🧪 Run $(Agent.JobName)
env:
DISPLAY: :99.0
CODE_VERSION: ${{ parameters.testVSCodeVersion }}

- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down
8 changes: 7 additions & 1 deletion test/vscodeLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ export async function prepareVSCodeAndExecuteTests(
userDataDir: string,
env: NodeJS.ProcessEnv
): Promise<number> {
const vscodeExecutablePath = await downloadAndUnzipVSCode('1.94.2');
let vscodeVersion = 'stable';
if (process.env.CODE_VERSION) {
console.log(`VSCode version overriden to ${process.env.CODE_VERSION}.`);
vscodeVersion = process.env.CODE_VERSION;
}

const vscodeExecutablePath = await downloadAndUnzipVSCode(vscodeVersion);
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);

console.log('Display: ' + env.DISPLAY);
Expand Down

0 comments on commit 490b6aa

Please sign in to comment.