Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Speed up travis build #415

Merged
merged 1 commit into from
Nov 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,27 @@ branches:
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
- stage: test
script: npm run test
# runs linting and fast integration/unit tests
- stage: "Basic Tests"
script:
- yarn lint:hbs
- yarn lint:js
- yarn test-fast

# runs slow end-to-end tests, parallelizing yarn and npm cases
- stage: "End-to-end Tests"
script:
- yarn test-slow
env: END_TO_END_TESTS=yarn
- env: END_TO_END_TESTS=npm

# Define the release stage that runs semantic-release
- stage: release
- stage: "Release"
node_js: lts/*
script: skip
deploy:
Expand All @@ -45,11 +61,10 @@ jobs:
script:
- npx semantic-release


before_install:
- yarn config set no-progress

install:
- yarn --frozen-lockfile
- yarn --frozen-lockfile --non-interactive
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
78 changes: 41 additions & 37 deletions node-tests/acceptance/end-to-end-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,53 +70,57 @@ describe('end-to-end', function() {
removeSync('electron-out');
});

describe('with yarn', function() {
before(function() {
let { name: tmpDir } = tmp.dirSync();
process.chdir(tmpDir);
if (!process.env.END_TO_END_TESTS || process.env.END_TO_END_TESTS === 'yarn') {
describe('with yarn', function() {
before(function() {
let { name: tmpDir } = tmp.dirSync();
process.chdir(tmpDir);

return ember('new', 'ee-test-app', '--yarn', '--skip-git', '--no-welcome').then(() => {
process.chdir('ee-test-app');
return ember('new', 'ee-test-app', '--yarn', '--skip-git', '--no-welcome').then(() => {
process.chdir('ee-test-app');

return ember('install', `ember-electron@${path.join(packageTmpDir, 'package')}`);
return ember('install', `ember-electron@${path.join(packageTmpDir, 'package')}`);
});
});
});

after(() => {
process.chdir(rootDir);
});
after(() => {
process.chdir(rootDir);
});

runTests();
});
runTests();
});
}

describe('with npm', function() {
before(function() {
let { name: tmpDir } = tmp.dirSync();
process.chdir(tmpDir);
if (!process.env.END_TO_END_TESTS || process.env.END_TO_END_TESTS === 'npm') {
describe('with npm', function() {
before(function() {
let { name: tmpDir } = tmp.dirSync();
process.chdir(tmpDir);

return ember('new', 'ee-test-app', '--yarn', 'false', '--skip-git', '--no-welcome').then(() => {
process.chdir('ee-test-app');
// For some reason, either ember-cli-dependency-checker isn't working with npm
// or npm isn't getting the right version because without this env var (or hacking package.json)
// we get:
// Missing npm packages:
// Package: ember-electron
// * Specified: file:../../tmp-230055rygYPzwOs0w/ember-electron-cachebust.tar
// * Installed: file:/tmp/tmp-230055rygYPzwOs0w/ember-electron-cachebust.tar
//
// Run `npm install` to install missing dependencies.
process.env.SKIP_DEPENDENCY_CHECKER = true;

return ember('install', `ember-electron@${path.join(packageTmpDir, 'ember-electron-cachebust.tar')}`, '--no-yarn');
});
});

return ember('new', 'ee-test-app', '--yarn', 'false', '--skip-git', '--no-welcome').then(() => {
process.chdir('ee-test-app');
// For some reason, either ember-cli-dependency-checker isn't working with npm
// or npm isn't getting the right version because without this env var (or hacking package.json)
// we get:
// Missing npm packages:
// Package: ember-electron
// * Specified: file:../../tmp-230055rygYPzwOs0w/ember-electron-cachebust.tar
// * Installed: file:/tmp/tmp-230055rygYPzwOs0w/ember-electron-cachebust.tar
//
// Run `npm install` to install missing dependencies.
process.env.SKIP_DEPENDENCY_CHECKER = true;

return ember('install', `ember-electron@${path.join(packageTmpDir, 'ember-electron-cachebust.tar')}`, '--no-yarn');
after(() => {
process.chdir(rootDir);
});
});

after(() => {
process.chdir(rootDir);
runTests();
});

runTests();
});
}

function runTests() {
it('tests', () => {
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@
"scripts": {
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"test": "yarn-or-npm run test-node-all",
"test-fast": "yarn-or-npm run test-node",
"test-node": "mocha node-tests/unit/**/*.js ./node-tests/integration/**/*.js",
"test-node-slow": "mocha ./node-tests/acceptance/**/*.js",
"test-node-all": "yarn-or-npm run test-node && yarn-or-npm run test-node-slow"
"test": "yarn test-fast && yarn test-slow",
"test-fast": "mocha node-tests/unit/**/*.js ./node-tests/integration/**/*.js",
"test-slow": "mocha ./node-tests/acceptance/**/*.js"
},
"dependencies": {
"broccoli-file-creator": "^2.1.1",
Expand Down