Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/copilot/test-integration-steps.yml
13383 views
1
parameters:
2
- name: OS
3
type: string # linux, darwin, win32
4
5
steps:
6
# Setup copilot test environment (tokens, env vars)
7
- task: AzureCLI@2
8
inputs:
9
azureSubscription: 'VS Code Development WIF'
10
${{ if eq(parameters.OS, 'win32') }}:
11
scriptType: 'pscore'
12
${{ else }}:
13
scriptType: 'bash'
14
scriptLocation: 'inlineScript'
15
inlineScript: npm run setup
16
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
17
displayName: Setup copilot test environment
18
19
# Compute the path to the VS Code build executable
20
- ${{ if eq(parameters.OS, 'linux') }}:
21
- script: |
22
set -e
23
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
24
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
25
echo "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$APP_ROOT/$APP_NAME"
26
displayName: Compute VS Code build path
27
28
- ${{ if eq(parameters.OS, 'darwin') }}:
29
- script: |
30
set -e
31
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
32
APP_NAME="$(ls $APP_ROOT | head -n 1)"
33
ProductJsonPath=$(find "$APP_ROOT" -name "product.json" -type f | head -n 1)
34
BINARY_NAME=$(jq -r '.nameShort' "$ProductJsonPath")
35
echo "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$APP_ROOT/$APP_NAME/Contents/MacOS/$BINARY_NAME"
36
displayName: Compute VS Code build path
37
38
- ${{ if eq(parameters.OS, 'win32') }}:
39
- powershell: |
40
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
41
$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)
42
$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json
43
$AppNameShort = $AppProductJson.nameShort
44
Write-Host "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$AppRoot\$AppNameShort.exe"
45
displayName: Compute VS Code build path
46
47
# Compile copilot extension for tests
48
- script: npm run compile
49
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
50
displayName: Compile copilot
51
52
# Run Copilot integration tests
53
- ${{ if eq(parameters.OS, 'linux') }}:
54
- script: xvfb-run -a npm run test:extension
55
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
56
displayName: Run Copilot extension tests
57
timeoutInMinutes: 15
58
env:
59
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
60
61
- script: xvfb-run -a npm run test:completions-core
62
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
63
displayName: Run Copilot completions core tests
64
timeoutInMinutes: 15
65
env:
66
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
67
68
- script: xvfb-run -a npm run test:sanity
69
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
70
displayName: Run Copilot sanity tests
71
timeoutInMinutes: 15
72
env:
73
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
74
75
- ${{ if eq(parameters.OS, 'darwin') }}:
76
- script: npm run test:extension
77
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
78
displayName: Run Copilot extension tests
79
timeoutInMinutes: 15
80
env:
81
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
82
83
- script: npm run test:completions-core
84
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
85
displayName: Run Copilot completions core tests
86
timeoutInMinutes: 15
87
env:
88
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
89
90
- script: npm run test:sanity
91
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
92
displayName: Run Copilot sanity tests
93
timeoutInMinutes: 15
94
env:
95
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
96
97
- ${{ if eq(parameters.OS, 'win32') }}:
98
- powershell: npm run test:extension
99
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
100
displayName: Run Copilot extension tests
101
timeoutInMinutes: 15
102
env:
103
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
104
105
# MAYBE https://dev.azure.com/monacotools/Monaco/_build/results?buildId=426316&view=logs&j=573fdb8c-432d-57b7-addd-e5c3edb6227f&t=6fad2a73-ceba-567d-939f-7bd557eba1dc&s=40b405d8-d9ea-5f38-8ab3-8db0b216e2d0
106
- powershell: npm run test:completions-core
107
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
108
displayName: Run Copilot completions core tests
109
timeoutInMinutes: 15
110
env:
111
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
112
113
- powershell: npm run test:sanity
114
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
115
displayName: Run Copilot sanity tests
116
timeoutInMinutes: 15
117
env:
118
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
119
120