Skip to content

Commit

Permalink
CI: enhanced appveyor test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Apr 11, 2018
1 parent a0f1671 commit 146f025
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
36 changes: 34 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,56 @@ version: "{build}"
clone_depth: 1

environment:
ESHOST_SKIP_D8: 1
ESHOST_SKIP_JSC: 1
ESHOST_SKIP_CHROME: 1
ESHOST_SKIP_FIREFOX: 1
# These are not skipped
# ESHOST_SKIP_JSSHELL: 1
# ESHOST_SKIP_CH: 1
# ESHOST_SKIP_NODE: 1
ESHOST_SKIP_REMOTE: 1
matrix:
- nodejs_version: 6
- nodejs_version: 8

platform:
- x86
- x64
- x86

install:
- ps: Install-Product node $env:nodejs_version
- set ESHOST_PATH=%CD%
- mkdir hosts
- mkdir spidermonkey
- curl -fsS -o spidermonkey\jsshell-win64.zip https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/jsshell-win64.zip
- 7z e -o%CD%\spidermonkey spidermonkey\jsshell-win64.zip
- set PATH=%PATH%;%CD%\spidermonkey\
- set ESHOST_JSSHELL_PATH=%CD%\spidermonkey\
- where js
- mkdir chakracore
# eventually, we want to have a pre-compiled debug build stored remotely
# - curl -fsSL -o chakracore\cc_windows_all_1_7_1.zip https://aka.ms/chakracore/cc_windows_all_1_7_1
# - 7z -y e -o%CD%\chakracore chakracore\cc_windows_all_1_7_1.zip
# - set PATH=%PATH%;%CD%\chakracore\
# - set ESHOST_CH_PATH=%CD%\chakracore\
- git clone https://github.com/Microsoft/ChakraCore.git chakracore
- msbuild /p:Platform=%PLATFORM% /p:Configuration=Debug %CD%\chakracore\Build\Chakra.Core.sln
- set PATH=%PATH%;%CD%\chakracore\Build\VcBuild\bin\%PLATFORM%_debug
- cd %CD%\chakracore\Build\VcBuild\bin\%PLATFORM%_debug
# - where ch
- cd %ESHOST_PATH%
- where node
- echo %PATH%
- node -v
- npm install -g npm
- npm install

build: off

test_script:
- ps: "npm run lint # PowerShell"
- cmd: npm run lint
- cmd: npm test

matrix:
fast_finish: true
29 changes: 22 additions & 7 deletions test/runify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const runify = require('../');
const assert = require('assert');
const hasbin = require('hasbin');
const fs = require('fs');
const path = require('path');

const isWindows = process.platform === 'win32' ||
process.env.OSTYPE === 'cygwin' ||
Expand All @@ -30,6 +31,21 @@ const hosts = [
],
];

// console.log(`isWindows: ${isWindows}`);
if (isWindows) {
hosts.forEach(record => {
if (record[1].hostPath) {
record[1].hostPath += '.exe';
const ESHOST_ENV_NAME = `ESHOST_${record[0].toUpperCase()}_PATH`;
console.log(`ESHOST_ENV_NAME: ${ESHOST_ENV_NAME}`);
if (process.env[ESHOST_ENV_NAME]) {
record[1].hostPath = path.join(process.env[ESHOST_ENV_NAME], record[1].hostPath);
}
}
});
}


const timeout = function(ms) {
return new Promise(res => {
setTimeout(res, ms);
Expand All @@ -41,20 +57,19 @@ hosts.forEach(function (record) {
const options = record[1];
const effectiveType = type === 'remote' ?
options.capabilities.browserName : type;
if (options.hostPath && isWindows) {
options.hostPath += '.exe';
}
const isSkipped = process.env[`ESHOST_SKIP_${effectiveType.toUpperCase()}`];
console.log(`ESHOST_SKIP_${effectiveType.toUpperCase()} isSkipped ${isSkipped}`);

if (options.hostPath &&
(!hasbin.sync(options.hostPath) && !fs.existsSync(options.hostPath))) {
console.error('Unable to run tests - host not found: ' + options.hostPath);
if (!isSkipped &&
(options.hostPath && (!hasbin.sync(options.hostPath) && !fs.existsSync(options.hostPath)))) {
console.error(`Unable to run tests - host not found: ${options.hostPath}`);
}

describe(`${type} (${options.hostPath || effectiveType})`, function () {
this.timeout(20000);

before(function() {
if (process.env['ESHOST_SKIP_' + type.toUpperCase()]) {
if (isSkipped) {
this.skip();
return;
}
Expand Down

0 comments on commit 146f025

Please sign in to comment.