Skip to content

Commit

Permalink
Build: Add macOS and Windows to the Travis CI test matrix
Browse files Browse the repository at this point in the history
Update grunt-contrib-qunit to 3.1.0, because grunt-contrib-qunit 3.0.1
uses a pinned (older) version of puppeteer. The older puppteer used an
older version of Chrome, which is incompatible with Windows Server 2016,
which is what Travis CI offers. AppVeyor was using Windows Server 2012,
whih was not affected by that Chrome bug.

Ref gruntjs/grunt-contrib-qunit#154.

For Windows, the build script is limited to `test:main`. This is the
same as it was before with AppVeyor, because the CLI tests are not passing
on Windows currently. Ref #1359.

Rename bin/qunit to bin/qunit.js, because otherwise ESLint fails:

> Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style

In theory, it should be possible to add an entry to `.gitattributes`
that will apply to bin/qunit what we apply to *.js, but I wasn't
able to find a way.

Fixes #1347.
  • Loading branch information
Krinkle committed Dec 30, 2018
1 parent fd53f74 commit c543b36
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.js eol=lf
*.json eol=lf
*.html eol=lf

21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
os: linux
language: node_js
node_js:
- "6"
- "8"
- "10"
- "8"
- "6"
env:
- NPM_SCRIPT=test
- NPM_SCRIPT=test:cli
matrix:
fast_finish: true
include:
- node_js: "10"
- os: windows
# On Windows, test only the last LTS.
node_js: "10"
# On Windows, run test:main only instead of test.
# https://github.com/qunitjs/qunit/issues/1359
# On Windows, disable yarn-gpg due to it causing the
# build to never finish (background process)
# https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336
env: NPM_SCRIPT=test:main YARN_GPG=no
- os: osx
# On Mac, test only the last LTS.
node_js: "10"
- os: linux
node_js: "10"
env: NPM_SCRIPT=coverage
script:
- npm run $NPM_SCRIPT
Expand Down
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ module.exports = function( grunt ) {
},
js: [
"*.js",
"bin/qunit",
"bin/**/*.js",
"reporter/**/*.js",
"runner/**/*.js",
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Travis Build Status](https://travis-ci.org/qunitjs/qunit.svg?branch=master)](https://travis-ci.org/qunitjs/qunit)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/qunitjs/qunit?svg=true&branch=master)](https://ci.appveyor.com/project/leobalter/qunit)
[![Build Status](https://travis-ci.org/qunitjs/qunit.svg?branch=master)](https://travis-ci.org/qunitjs/qunit)
[![Coverage Status](https://coveralls.io/repos/qunitjs/qunit/badge.svg)](https://coveralls.io/github/qunitjs/qunit)
[![Chat on Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qunitjs/qunit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fqunitjs%2Fqunit.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fqunitjs%2Fqunit?ref=badge_shield)
Expand Down
24 changes: 0 additions & 24 deletions appveyor.yml

This file was deleted.

File renamed without changes.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"license": "MIT",
"bin": {
"qunit": "bin/qunit"
"qunit": "bin/qunit.js"
},
"files": [
"bin/",
Expand Down Expand Up @@ -60,7 +60,7 @@
"grunt-concurrent": "2.3.1",
"grunt-contrib-connect": "1.0.2",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-qunit": "3.0.1",
"grunt-contrib-qunit": "3.1.0",
"grunt-contrib-watch": "1.1.0",
"grunt-coveralls": "2.0.0",
"grunt-eslint": "20.1.0",
Expand All @@ -79,9 +79,10 @@
"scripts": {
"build": "grunt build",
"dev": "grunt watch",
"test": "grunt",
"coverage": "grunt coverage",
"test:cli": "grunt build && bin/qunit test/cli/*.js"
"test": "grunt && bin/qunit.js test/cli/*.js",
"test:main": "grunt",
"test:cli": "grunt build && bin/qunit.js test/cli/*.js",
"coverage": "grunt coverage"
},
"commitplease": {
"components": [
Expand Down
2 changes: 1 addition & 1 deletion test/cli/fixtures/expected/tap-outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ok 1 Single > has a test
# todo 0
# fail 0`,

"node --expose-gc --allow-natives-syntax ../../../bin/qunit memory-leak/*.js":
"node --expose-gc --allow-natives-syntax ../../../bin/qunit.js memory-leak/*.js":
`TAP version 13
ok 1 some nested module > can call method on foo
ok 2 later thing > has released all foos
Expand Down
2 changes: 1 addition & 1 deletion test/cli/helpers/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function execute( command, execaOptions ) {
const cwd = process.cwd();
process.chdir( path.join( __dirname, "..", "fixtures" ) );

command = command.replace( /^qunit\b/, "../../../bin/qunit" );
command = command.replace( /^qunit\b/, "../../../bin/qunit.js" );
const execution = exec( command, execaOptions );

process.chdir( cwd );
Expand Down
2 changes: 1 addition & 1 deletion test/cli/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ QUnit.module( "CLI Main", function() {

if ( semver.gte( process.versions.node, "9.0.0" ) ) {
QUnit.test( "callbacks and hooks from modules are properly released for garbage collection", co.wrap( function* ( assert ) {
const command = "node --expose-gc --allow-natives-syntax ../../../bin/qunit memory-leak/*.js";
const command = "node --expose-gc --allow-natives-syntax ../../../bin/qunit.js memory-leak/*.js";
const execution = yield execute( command );

assert.equal( execution.code, 0 );
Expand Down

0 comments on commit c543b36

Please sign in to comment.