ci: run tests on WOA hardware (#20031)

* ci: run tests on WOA hardware

* Temporarily disable test until #20008 is resolved

* deterministically run tests in sorted order
This commit is contained in:
John Kleinschmidt 2019-09-03 13:13:06 -04:00 committed by GitHub
parent 96c3fec855
commit bedc5f7da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 25 deletions

View file

@ -138,6 +138,5 @@ deploy_script:
& python script\release\uploaders\upload.py & python script\release\uploaders\upload.py
} }
} elseif (Test-Path Env:\TEST_WOA) { } elseif (Test-Path Env:\TEST_WOA) {
# node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
echo "Eventually run tests on WOA hardware at this step"
} }

View file

@ -6,8 +6,8 @@ steps:
- script: | - script: |
cd src\electron cd src\electron
npm install --verbose node script/yarn.js install --frozen-lockfile
displayName: 'NPM install' displayName: 'Yarn install'
- powershell: | - powershell: |
$localArtifactPath = "$pwd\dist.zip" $localArtifactPath = "$pwd\dist.zip"
@ -27,16 +27,6 @@ steps:
env: env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
$localArtifactPath = "$pwd\src\out\Default\mksnapshot.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/mksnapshot.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
cd src\out\Default
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y mksnapshot.zip
displayName: 'Download and unzip mksnapshot.zip for test'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: | - powershell: |
$localArtifactPath = "$pwd\src\node_headers.zip" $localArtifactPath = "$pwd\src\node_headers.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip" $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
@ -70,6 +60,16 @@ steps:
env: env:
ELECTRON_OUT_DIR: Default ELECTRON_OUT_DIR: Default
IGNORE_YARN_INSTALL_ERROR: 1 IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
condition: always()
- script: | - script: |
cd src cd src
@ -78,7 +78,7 @@ steps:
displayName: 'Verify ffmpeg' displayName: 'Verify ffmpeg'
- script: | - script: |
cd src taskkill /F /IM electron.exe
echo "Verifying mksnapshot" taskkill /F /IM MicrosoftEdge.exe
python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% displayName: 'Kill processes left running from last test run'
displayName: 'Verify mksnapshot' condition: always()

View file

@ -73,7 +73,8 @@ async function main () {
function generateTypeDefinitions () { function generateTypeDefinitions () {
const { status } = childProcess.spawnSync('npm', ['run', 'create-typescript-definitions'], { const { status } = childProcess.spawnSync('npm', ['run', 'create-typescript-definitions'], {
cwd: path.resolve(__dirname, '..'), cwd: path.resolve(__dirname, '..'),
stdio: 'inherit' stdio: 'inherit',
shell: true
}) })
if (status !== 0) { if (status !== 0) {
throw new Error(`Electron typescript definition generation failed with exit code: ${status}.`) throw new Error(`Electron typescript definition generation failed with exit code: ${status}.`)

View file

@ -2,6 +2,7 @@
from __future__ import print_function from __future__ import print_function
import argparse import argparse
import os import os
import platform
import shutil import shutil
import subprocess import subprocess
import sys import sys
@ -46,7 +47,10 @@ def main():
env['ELECTRON_ENABLE_STACK_DUMPING'] = 'true' env['ELECTRON_ENABLE_STACK_DUMPING'] = 'true'
# FIXME: Enable after ELECTRON_ENABLE_LOGGING works again # FIXME: Enable after ELECTRON_ENABLE_LOGGING works again
# env['ELECTRON_ENABLE_LOGGING'] = 'true' # env['ELECTRON_ENABLE_LOGGING'] = 'true'
subprocess.check_call([electron, test_path] + sys.argv[1:], env=env) testargs = [electron, test_path]
if sys.platform == 'win32' and platform.machine() == 'ARM64':
testargs.append('--disable-accelerated-video-decode')
subprocess.check_call(testargs, env=env)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
returncode = e.returncode returncode = e.returncode
except KeyboardInterrupt: except KeyboardInterrupt:

View file

@ -244,7 +244,10 @@ describe('webContents module', () => {
.and.have.property('code', 'ERR_FILE_NOT_FOUND') .and.have.property('code', 'ERR_FILE_NOT_FOUND')
}) })
it('rejects when loading fails due to DNS not resolved', async () => { // Temporarily disable on WOA until
// https://github.com/electron/electron/issues/20008 is resolved
const testFn = (process.platform === 'win32' && process.arch === 'arm64' ? it.skip : it)
testFn('rejects when loading fails due to DNS not resolved', async () => {
await expect(w.loadURL('https://err.name.not.resolved')).to.eventually.be.rejected() await expect(w.loadURL('https://err.name.not.resolved')).to.eventually.be.rejected()
.and.have.property('code', 'ERR_NAME_NOT_RESOLVED') .and.have.property('code', 'ERR_NAME_NOT_RESOLVED')
}) })
@ -331,7 +334,9 @@ describe('webContents module', () => {
describe('getFocusedWebContents() API', () => { describe('getFocusedWebContents() API', () => {
afterEach(closeAllWindows) afterEach(closeAllWindows)
it('returns the focused web contents', async () => {
const testFn = (process.platform === 'win32' && process.arch === 'arm64' ? it.skip : it)
testFn('returns the focused web contents', async () => {
const w = new BrowserWindow({show: true}) const w = new BrowserWindow({show: true})
await w.loadURL('about:blank') await w.loadURL('about:blank')
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id) expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id)

View file

@ -78,14 +78,17 @@ app.whenReady().then(() => {
? new RegExp(process.env.npm_config_match, 'g') ? new RegExp(process.env.npm_config_match, 'g')
: null : null
const testFiles = []
walker.on('file', (file) => { walker.on('file', (file) => {
if (/-spec\.[tj]s$/.test(file) && if (/-spec\.[tj]s$/.test(file) &&
(!moduleMatch || moduleMatch.test(file))) { (!moduleMatch || moduleMatch.test(file))) {
mocha.addFile(file) testFiles.push(file)
} }
}) })
walker.on('end', () => { walker.on('end', () => {
testFiles.sort()
testFiles.forEach((file) => mocha.addFile(file))
const cb = () => { const cb = () => {
// Ensure the callback is called after runner is defined // Ensure the callback is called after runner is defined
process.nextTick(() => { process.nextTick(() => {

View file

@ -157,7 +157,7 @@ describe('crashReporter module', () => {
return return
} }
// TODO(alexeykuzmin): Skip the test instead of marking it as passed. // TODO(alexeykuzmin): Skip the test instead of marking it as passed.
if (process.env.APPVEYOR === 'True') return done() if (process.platform === 'win32') return done()
this.timeout(specTimeout) this.timeout(specTimeout)
stopServer = startServer({ stopServer = startServer({
callback (port) { callback (port) {

View file

@ -84,14 +84,17 @@
? new RegExp(process.env.npm_config_match, 'g') ? new RegExp(process.env.npm_config_match, 'g')
: null : null
const testFiles = []
walker.on('file', (file) => { walker.on('file', (file) => {
if (/-spec\.js$/.test(file) && !file.includes(crashSpec) && if (/-spec\.js$/.test(file) && !file.includes(crashSpec) &&
(!moduleMatch || moduleMatch.test(file))) { (!moduleMatch || moduleMatch.test(file))) {
mocha.addFile(file) testFiles.push(file)
} }
}) })
walker.on('end', () => { walker.on('end', () => {
testFiles.sort()
testFiles.forEach((file) => mocha.addFile(file))
if (!process.env.npm_config_match || new RegExp(process.env.npm_config_match, 'g').test(crashSpec)) { if (!process.env.npm_config_match || new RegExp(process.env.npm_config_match, 'g').test(crashSpec)) {
mocha.addFile(path.resolve(__dirname, '..', crashSpec)) mocha.addFile(path.resolve(__dirname, '..', crashSpec))
} }