mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
ci: test on woa hardware (6-0-x) (#20092)
* ci: test on woa hardware * 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 (cherry picked from commitbedc5f7da9) * Disable test on WOA until #20008 is resolved * use request instead of blur to detect openExternal success * use blur event on mac, sigh * oh, right, still gotta open an actual url * Try to track down GPUinfo failure * Make function async * Check exitCode * Try to resolve bad exit code on GPUInfo test * Add logging to figure out failures on BrowserWindow.moveTop() * Revert "Add logging to figure out failures on BrowserWindow.moveTop()" This reverts commite21ace30dc. * Disable test until #20110 is resolved * fix lint issue
This commit is contained in:
committed by
GitHub
parent
0f27712e8f
commit
ed9b96ce9e
@@ -119,6 +119,5 @@ deploy_script:
|
||||
& python script\upload.py
|
||||
}
|
||||
} 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
|
||||
echo "Eventually run tests on WOA hardware at this step"
|
||||
node script/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ steps:
|
||||
|
||||
- script: |
|
||||
cd src\electron
|
||||
npm install --verbose
|
||||
displayName: 'NPM install'
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
displayName: 'Yarn install'
|
||||
|
||||
- powershell: |
|
||||
$localArtifactPath = "$pwd\dist.zip"
|
||||
@@ -27,16 +27,6 @@ steps:
|
||||
env:
|
||||
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: |
|
||||
$localArtifactPath = "$pwd\src\node_headers.zip"
|
||||
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
|
||||
@@ -70,6 +60,16 @@ steps:
|
||||
env:
|
||||
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
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Test Results'
|
||||
inputs:
|
||||
testResultsFiles: '*.xml'
|
||||
searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
|
||||
condition: always()
|
||||
|
||||
- script: |
|
||||
cd src
|
||||
@@ -78,7 +78,7 @@ steps:
|
||||
displayName: 'Verify ffmpeg'
|
||||
|
||||
- script: |
|
||||
cd src
|
||||
echo "Verifying mksnapshot"
|
||||
python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
|
||||
displayName: 'Verify mksnapshot'
|
||||
taskkill /F /IM electron.exe
|
||||
taskkill /F /IM MicrosoftEdge.exe
|
||||
displayName: 'Kill processes left running from last test run'
|
||||
condition: always()
|
||||
@@ -60,7 +60,8 @@ async function main () {
|
||||
function generateTypeDefinitions () {
|
||||
const { status } = childProcess.spawnSync('npm', ['run', 'create-typescript-definitions'], {
|
||||
cwd: path.resolve(__dirname, '..'),
|
||||
stdio: 'inherit'
|
||||
stdio: 'inherit',
|
||||
shell: true
|
||||
})
|
||||
if (status !== 0) {
|
||||
throw new Error(`Electron typescript definition generation failed with exit code: ${status}.`)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -45,7 +46,10 @@ def main():
|
||||
env['ELECTRON_ENABLE_STACK_DUMPING'] = 'true'
|
||||
# FIXME: Enable after ELECTRON_ENABLE_LOGGING works again
|
||||
# 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:
|
||||
returncode = e.returncode
|
||||
except KeyboardInterrupt:
|
||||
|
||||
@@ -1034,6 +1034,9 @@ describe('app module', () => {
|
||||
return JSON.parse(gpuInfoData)
|
||||
} else {
|
||||
// return error if not clean exit
|
||||
console.log('Error getting GPU INFO, exit code is:', exitCode)
|
||||
console.log('Error getting GPU INFO', errorData)
|
||||
console.log('GPU data: ', gpuInfoData)
|
||||
return Promise.reject(new Error(errorData))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,17 @@ app.whenReady().then(() => {
|
||||
? new RegExp(process.env.npm_config_match, 'g')
|
||||
: null
|
||||
|
||||
const testFiles = []
|
||||
walker.on('file', (file) => {
|
||||
if (/-spec\.[tj]s$/.test(file) &&
|
||||
(!moduleMatch || moduleMatch.test(file))) {
|
||||
mocha.addFile(file)
|
||||
testFiles.push(file)
|
||||
}
|
||||
})
|
||||
|
||||
walker.on('end', () => {
|
||||
testFiles.sort()
|
||||
testFiles.forEach((file) => mocha.addFile(file))
|
||||
const cb = () => {
|
||||
// Ensure the callback is called after runner is defined
|
||||
process.nextTick(() => {
|
||||
|
||||
@@ -514,7 +514,10 @@ describe('BrowserWindow module', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('BrowserWindow.moveTop()', () => {
|
||||
// Temporarily disable on WOA until
|
||||
// https://github.com/electron/electron/issues/20110 is resolved
|
||||
const skip = process.platform === 'win32' && process.arch === 'arm64';
|
||||
(skip ? describe.skip : describe)('BrowserWindow.moveTop()', () => {
|
||||
it('should not steal focus', async () => {
|
||||
const posDelta = 50
|
||||
const wShownInactive = emittedOnce(w, 'show')
|
||||
|
||||
@@ -2,10 +2,12 @@ const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
const http = require('http')
|
||||
const { shell, remote } = require('electron')
|
||||
const { BrowserWindow } = remote
|
||||
|
||||
const { closeWindow } = require('./window-helpers')
|
||||
const { emittedOnce } = require('./events-helpers')
|
||||
|
||||
describe('shell module', () => {
|
||||
const fixtures = path.resolve(__dirname, 'fixtures')
|
||||
@@ -42,32 +44,34 @@ describe('shell module', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('opens an external link asynchronously', done => {
|
||||
const url = 'http://www.example.com'
|
||||
it('opens an external link asynchronously', async () => {
|
||||
let url = 'http://127.0.0.1'
|
||||
let requestReceived
|
||||
if (process.platform === 'linux') {
|
||||
process.env.BROWSER = '/bin/true'
|
||||
process.env.DE = 'generic'
|
||||
process.env.DISPLAY = ''
|
||||
requestReceived = Promise.resolve()
|
||||
} else if (process.platform === 'darwin') {
|
||||
// On the Mac CI machines, Safari tries to ask for a password to the
|
||||
// code signing keychain we set up to test code signing (see
|
||||
// https://github.com/electron/electron/pull/19969#issuecomment-526278890),
|
||||
// so use a blur event as a crude proxy.
|
||||
w = new BrowserWindow({ show: true })
|
||||
requestReceived = emittedOnce(w, 'blur')
|
||||
} else {
|
||||
const server = http.createServer((req, res) => {
|
||||
res.end()
|
||||
})
|
||||
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve))
|
||||
requestReceived = new Promise(resolve => server.on('connection', () => resolve()))
|
||||
url = `http://127.0.0.1:${server.address().port}`
|
||||
}
|
||||
|
||||
// Ensure an external window is activated via a new window's blur event
|
||||
w = new BrowserWindow()
|
||||
let promiseResolved = false
|
||||
let blurEventEmitted = false
|
||||
|
||||
w.on('blur', () => {
|
||||
blurEventEmitted = true
|
||||
if (promiseResolved) {
|
||||
done()
|
||||
}
|
||||
})
|
||||
|
||||
shell.openExternal(url).then(() => {
|
||||
promiseResolved = true
|
||||
if (blurEventEmitted || process.platform === 'linux') {
|
||||
done()
|
||||
}
|
||||
})
|
||||
await Promise.all([
|
||||
shell.openExternal(url),
|
||||
requestReceived
|
||||
])
|
||||
})
|
||||
|
||||
it('opens an external link synchronously', () => {
|
||||
|
||||
@@ -55,7 +55,10 @@ describe('webContents module', () => {
|
||||
.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
|
||||
.and.have.property('code', 'ERR_NAME_NOT_RESOLVED')
|
||||
})
|
||||
|
||||
6
spec/fixtures/api/gpu-info.js
vendored
6
spec/fixtures/api/gpu-info.js
vendored
@@ -6,8 +6,10 @@ app.on('ready', () => {
|
||||
const infoType = process.argv.pop()
|
||||
app.getGPUInfo(infoType).then(
|
||||
(gpuInfo) => {
|
||||
console.log(JSON.stringify(gpuInfo))
|
||||
app.exit(0)
|
||||
setImmediate(() => {
|
||||
console.log(JSON.stringify(gpuInfo))
|
||||
app.exit(0)
|
||||
})
|
||||
},
|
||||
(error) => {
|
||||
console.error(error)
|
||||
|
||||
@@ -81,14 +81,17 @@
|
||||
? new RegExp(process.env.npm_config_match, 'g')
|
||||
: null
|
||||
|
||||
const testFiles = []
|
||||
walker.on('file', (file) => {
|
||||
if (/-spec\.js$/.test(file) && !file.includes(crashSpec) &&
|
||||
(!moduleMatch || moduleMatch.test(file))) {
|
||||
mocha.addFile(file)
|
||||
testFiles.push(file)
|
||||
}
|
||||
})
|
||||
|
||||
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)) {
|
||||
mocha.addFile(path.resolve(__dirname, '..', crashSpec))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user