diff --git a/appveyor.yml b/appveyor.yml index 0fa0c0d9bdd..a3fd5192558 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,10 +14,6 @@ install: - cmd: SET PATH=C:\python27;%PATH% - cmd: python script/cibuild -branches: - only: - - master - # disable build and test pahses build: off test: off diff --git a/script/cibuild b/script/cibuild index 59437837aa1..7d025b4e82c 100755 --- a/script/cibuild +++ b/script/cibuild @@ -75,8 +75,10 @@ def main(): run_script('create-dist.py') run_script('upload.py') else: + if PLATFORM == 'win32': + os.environ['OUTPUT_TO_FILE'] = 'output.log' run_script('build.py', ['-c', 'D']) - if PLATFORM != 'win32' and target_arch == 'x64': + if PLATFORM == 'win32' or target_arch == 'x64': run_script('test.py', ['--ci']) diff --git a/script/test.py b/script/test.py index 28aeac9dc1f..5adfd4eed6c 100755 --- a/script/test.py +++ b/script/test.py @@ -4,7 +4,7 @@ import os import subprocess import sys -from lib.util import atom_gyp +from lib.util import atom_gyp, rm_rf SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -30,7 +30,20 @@ def main(): else: atom_shell = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME) - subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:]) + returncode = 0 + try: + subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:]) + except subprocess.CalledProcessError as e: + returncode = e.returncode + + if os.environ.has_key('OUTPUT_TO_FILE'): + output_to_file = os.environ['OUTPUT_TO_FILE'] + with open(output_to_file, 'r') as f: + print f.read() + rm_rf(output_to_file) + + + return returncode if __name__ == '__main__': diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index c364b916c3a..e76821020bd 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -173,11 +173,12 @@ describe('browser-window module', function () { }) it('does not crash in did-fail-provisional-load handler', function (done) { + this.timeout(10000) w.webContents.once('did-fail-provisional-load', function () { - w.loadURL('http://localhost:11111') + w.loadURL('http://127.0.0.1:11111') done() }) - w.loadURL('http://localhost:11111') + w.loadURL('http://127.0.0.1:11111') }) }) diff --git a/spec/api-desktop-capturer-spec.js b/spec/api-desktop-capturer-spec.js index 68ab2463087..35b7248ed5e 100644 --- a/spec/api-desktop-capturer-spec.js +++ b/spec/api-desktop-capturer-spec.js @@ -1,7 +1,13 @@ const assert = require('assert') const desktopCapturer = require('electron').desktopCapturer +const isCI = require('electron').remote.getGlobal('isCi') + describe('desktopCapturer', function () { + if (isCI && process.platform === 'win32') { + return + } + it('should return a non-empty array of sources', function (done) { desktopCapturer.getSources({ types: ['window', 'screen'] diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 1d37d0fe051..577f020128a 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -62,6 +62,10 @@ describe('chromium feature', function () { w.loadURL(url) }) + if (isCI && process.platform === 'win32') { + return + } + it('is set correctly when window is inactive', function (done) { w = new BrowserWindow({ show: false @@ -97,6 +101,9 @@ describe('chromium feature', function () { if (isCI && process.platform === 'linux') { return } + if (isCI && process.platform === 'win32') { + return + } it('can return labels of enumerated devices', function (done) { navigator.mediaDevices.enumerateDevices().then((devices) => { @@ -327,6 +334,10 @@ describe('chromium feature', function () { }) describe('webgl', function () { + if (isCI && process.platform === 'win32') { + return + } + it('can be get as context in canvas', function () { if (process.platform === 'linux') return diff --git a/spec/static/main.js b/spec/static/main.js index 84e9ba3da55..025ff394bc6 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -7,8 +7,10 @@ const ipcMain = electron.ipcMain const dialog = electron.dialog const BrowserWindow = electron.BrowserWindow +const fs = require('fs') const path = require('path') const url = require('url') +const util = require('util') var argv = require('yargs') .boolean('ci') @@ -35,13 +37,18 @@ ipcMain.on('message', function (event, arg) { event.sender.send('message', arg) }) -ipcMain.on('console.log', function (event, args) { - console.error.apply(console, args) -}) - -ipcMain.on('console.error', function (event, args) { - console.error.apply(console, args) -}) +// Write output to file if OUTPUT_TO_FILE is defined. +const outputToFile = process.env.OUTPUT_TO_FILE +const print = function (_, args) { + let output = util.format.apply(null, args) + if (outputToFile) { + fs.appendFileSync(outputToFile, output + '\n') + } else { + console.error(output) + } +} +ipcMain.on('console.log', print) +ipcMain.on('console.error', print) ipcMain.on('process.exit', function (event, code) { process.exit(code)