mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
119 lines
4.7 KiB
YAML
119 lines
4.7 KiB
YAML
parameters:
|
|
- name: OS
|
|
type: string # linux, darwin, win32
|
|
|
|
steps:
|
|
# Setup copilot test environment (tokens, env vars)
|
|
- task: AzureCLI@2
|
|
inputs:
|
|
azureSubscription: 'VS Code Development WIF'
|
|
${{ if eq(parameters.OS, 'win32') }}:
|
|
scriptType: 'pscore'
|
|
${{ else }}:
|
|
scriptType: 'bash'
|
|
scriptLocation: 'inlineScript'
|
|
inlineScript: npm run setup
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: Setup copilot test environment
|
|
|
|
# Compute the path to the VS Code build executable
|
|
- ${{ if eq(parameters.OS, 'linux') }}:
|
|
- script: |
|
|
set -e
|
|
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
|
|
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
|
|
echo "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$APP_ROOT/$APP_NAME"
|
|
displayName: Compute VS Code build path
|
|
|
|
- ${{ if eq(parameters.OS, 'darwin') }}:
|
|
- script: |
|
|
set -e
|
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
|
APP_NAME="$(ls $APP_ROOT | head -n 1)"
|
|
ProductJsonPath=$(find "$APP_ROOT" -name "product.json" -type f | head -n 1)
|
|
BINARY_NAME=$(jq -r '.nameShort' "$ProductJsonPath")
|
|
echo "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$APP_ROOT/$APP_NAME/Contents/MacOS/$BINARY_NAME"
|
|
displayName: Compute VS Code build path
|
|
|
|
- ${{ if eq(parameters.OS, 'win32') }}:
|
|
- powershell: |
|
|
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
|
|
$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)
|
|
$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json
|
|
$AppNameShort = $AppProductJson.nameShort
|
|
Write-Host "##vso[task.setvariable variable=VSCODE_UNDER_TEST]$AppRoot\$AppNameShort.exe"
|
|
displayName: Compute VS Code build path
|
|
|
|
# Compile copilot extension for tests
|
|
- script: npm run compile
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: Compile copilot
|
|
|
|
# Run Copilot integration tests
|
|
- ${{ if eq(parameters.OS, 'linux') }}:
|
|
- script: xvfb-run -a npm run test:extension
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot extension tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- script: xvfb-run -a npm run test:completions-core
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot completions core tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- script: xvfb-run -a npm run test:sanity
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot sanity tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- ${{ if eq(parameters.OS, 'darwin') }}:
|
|
- script: npm run test:extension
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot extension tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- script: npm run test:completions-core
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot completions core tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- script: npm run test:sanity
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot sanity tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- ${{ if eq(parameters.OS, 'win32') }}:
|
|
- powershell: npm run test:extension
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot extension tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
# 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
|
|
- powershell: npm run test:completions-core
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot completions core tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|
|
|
|
- powershell: npm run test:sanity
|
|
workingDirectory: $(Build.SourcesDirectory)/extensions/copilot
|
|
displayName: 🧪 Run Copilot sanity tests
|
|
timeoutInMinutes: 15
|
|
env:
|
|
VSCODE_UNDER_TEST: $(VSCODE_UNDER_TEST)
|