2022-02-25 21:17:35 +03:00
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
2019-08-22 00:37:30 +03:00
|
|
|
steps:
|
2022-02-25 21:17:35 +03:00
|
|
|
- checkout: self
|
|
|
|
path: src\electron
|
2019-08-22 00:37:30 +03:00
|
|
|
|
|
|
|
- script: |
|
2019-09-03 20:13:06 +03:00
|
|
|
node script/yarn.js install --frozen-lockfile
|
|
|
|
displayName: 'Yarn install'
|
2019-08-22 00:37:30 +03:00
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$localArtifactPath = "$pwd\dist.zip"
|
|
|
|
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/dist.zip"
|
|
|
|
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
2022-02-25 21:17:35 +03:00
|
|
|
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -o$(Pipeline.Workspace)\src\out\Default -y $localArtifactPath
|
2019-08-22 00:37:30 +03:00
|
|
|
displayName: 'Download and extract dist.zip for test'
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
|
|
|
|
2019-10-03 23:21:30 +03:00
|
|
|
- powershell: |
|
2022-02-25 21:17:35 +03:00
|
|
|
$localArtifactPath = "$(Pipeline.Workspace)\src\out\Default\shell_browser_ui_unittests.exe"
|
2019-10-03 23:21:30 +03:00
|
|
|
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/shell_browser_ui_unittests.exe"
|
|
|
|
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
|
|
|
displayName: 'Download and extract native test executables for test'
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
|
|
|
|
2019-08-22 00:37:30 +03:00
|
|
|
- powershell: |
|
|
|
|
$localArtifactPath = "$pwd\ffmpeg.zip"
|
|
|
|
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/ffmpeg.zip"
|
|
|
|
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
2022-02-25 21:17:35 +03:00
|
|
|
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -o$(Pipeline.Workspace)\src\out\ffmpeg $localArtifactPath
|
2019-08-22 00:37:30 +03:00
|
|
|
displayName: 'Download and extract ffmpeg.zip for test'
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
|
|
|
|
|
|
|
- powershell: |
|
2022-02-25 21:17:35 +03:00
|
|
|
$localArtifactPath = "$(Pipeline.Workspace)\src\node_headers.zip"
|
2019-08-22 00:37:30 +03:00
|
|
|
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
|
|
|
|
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
2022-02-25 21:17:35 +03:00
|
|
|
cd $(Pipeline.Workspace)\src
|
2019-08-22 00:37:30 +03:00
|
|
|
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
|
|
|
|
displayName: 'Download node headers for test'
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
|
|
|
|
|
|
|
- powershell: |
|
2022-02-25 21:17:35 +03:00
|
|
|
$localArtifactPath = "$(Pipeline.Workspace)\src\out\Default\electron.lib"
|
2019-08-22 00:37:30 +03:00
|
|
|
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/electron.lib"
|
|
|
|
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
|
|
|
displayName: 'Download electron.lib for test'
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
|
|
|
|
2022-02-25 21:17:35 +03:00
|
|
|
# Uncomment the following block if pdb files are needed to debug issues
|
|
|
|
# - powershell: |
|
|
|
|
# try {
|
|
|
|
# $localArtifactPath = "$(Pipeline.Workspace)\src\pdb.zip"
|
|
|
|
# $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
|
|
|
|
# Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
|
|
|
|
# cd $(Pipeline.Workspace)\src
|
|
|
|
# & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
|
|
|
|
# } catch {
|
|
|
|
# Write-Host "There was an exception encountered while downloading pdb files:" $_.Exception.Message
|
|
|
|
# } finally {
|
|
|
|
# $global:LASTEXITCODE = 0
|
|
|
|
# }
|
|
|
|
# displayName: 'Download pdb files for detailed stacktraces'
|
|
|
|
# env:
|
|
|
|
# APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
|
2021-07-15 18:25:00 +03:00
|
|
|
|
2019-08-22 00:37:30 +03:00
|
|
|
- powershell: |
|
2022-02-25 21:17:35 +03:00
|
|
|
New-Item $(Pipeline.Workspace)\src\out\Default\gen\node_headers\Release -Type directory
|
|
|
|
Copy-Item -path $(Pipeline.Workspace)\src\out\Default\electron.lib -destination $(Pipeline.Workspace)\src\out\Default\gen\node_headers\Release\node.lib
|
2019-08-22 00:37:30 +03:00
|
|
|
displayName: 'Setup node headers'
|
|
|
|
|
|
|
|
- script: |
|
2022-02-25 21:17:35 +03:00
|
|
|
cd $(Pipeline.Workspace)\src
|
2019-08-22 00:37:30 +03:00
|
|
|
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
|
|
|
set npm_config_arch=arm64
|
|
|
|
cd electron
|
2022-02-25 21:17:35 +03:00
|
|
|
node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
|
2021-07-15 18:25:00 +03:00
|
|
|
displayName: 'Run Electron Main process tests'
|
|
|
|
env:
|
|
|
|
ELECTRON_ENABLE_STACK_DUMPING: true
|
|
|
|
ELECTRON_OUT_DIR: Default
|
|
|
|
IGNORE_YARN_INSTALL_ERROR: 1
|
|
|
|
ELECTRON_TEST_RESULTS_DIR: junit
|
|
|
|
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
|
|
|
MOCHA_REPORTER: mocha-multi-reporters
|
|
|
|
|
|
|
|
- script: |
|
2022-02-25 21:17:35 +03:00
|
|
|
cd $(Pipeline.Workspace)\src
|
2021-07-15 18:25:00 +03:00
|
|
|
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
|
|
|
set npm_config_arch=arm64
|
|
|
|
cd electron
|
|
|
|
node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
|
|
|
|
displayName: 'Run Electron Remote based tests'
|
2019-08-22 00:37:30 +03:00
|
|
|
env:
|
|
|
|
ELECTRON_OUT_DIR: Default
|
|
|
|
IGNORE_YARN_INSTALL_ERROR: 1
|
2019-09-03 20:13:06 +03:00
|
|
|
ELECTRON_TEST_RESULTS_DIR: junit
|
|
|
|
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
|
|
|
MOCHA_REPORTER: mocha-multi-reporters
|
2022-02-25 21:17:35 +03:00
|
|
|
condition: succeededOrFailed()
|
2019-09-03 20:13:06 +03:00
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: 'Publish Test Results'
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '*.xml'
|
2022-02-25 21:17:35 +03:00
|
|
|
searchFolder: '$(Pipeline.Workspace)/src/junit/'
|
2019-09-03 20:13:06 +03:00
|
|
|
condition: always()
|
2019-08-22 00:37:30 +03:00
|
|
|
|
|
|
|
- script: |
|
2022-02-25 21:17:35 +03:00
|
|
|
cd $(Pipeline.Workspace)\src
|
2019-08-22 00:37:30 +03:00
|
|
|
echo "Verifying non proprietary ffmpeg"
|
|
|
|
python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
|
|
|
displayName: 'Verify ffmpeg'
|
|
|
|
|
2019-09-18 23:44:48 +03:00
|
|
|
- powershell: |
|
2019-09-19 18:35:31 +03:00
|
|
|
Get-Process | Where Name –Like "electron*" | Stop-Process
|
2020-04-29 21:06:38 +03:00
|
|
|
Get-Process | Where Name –Like "msedge*" | Stop-Process
|
2019-09-03 20:13:06 +03:00
|
|
|
displayName: 'Kill processes left running from last test run'
|
2019-10-31 02:38:21 +03:00
|
|
|
condition: always()
|
2020-08-24 19:58:55 +03:00
|
|
|
|
|
|
|
- powershell: |
|
2021-02-15 03:44:32 +03:00
|
|
|
Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
|
2020-08-24 19:58:55 +03:00
|
|
|
displayName: 'Delete user app data directories'
|
|
|
|
condition: always()
|