Skip to content

Commit 3e10bd1

Browse files
authored
fix(ember): Restrict compatibility tests to CI (#3069)
This implements a check before running ember tests, to see whether we're in a CI environment or not, and skips running tests against multiple versions of ember if we aren't (under the assumption that while we like the security of doing ALL of the checks in CI, testing against one ember version locally should be enough to let us know whether or not we broke something). Doing this speeds up local ember tests by a factor of 25x-30x.
1 parent d2bd4c5 commit 3e10bd1

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

packages/ember/config/ember-try.js

+29-29
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,41 @@ module.exports = async function() {
1010
name: 'ember-lts-3.12',
1111
npm: {
1212
devDependencies: {
13-
'ember-source': '~3.12.0'
14-
}
15-
}
13+
'ember-source': '~3.12.0',
14+
},
15+
},
1616
},
1717
{
1818
name: 'ember-lts-3.16',
1919
npm: {
2020
devDependencies: {
21-
'ember-source': '~3.16.0'
22-
}
23-
}
21+
'ember-source': '~3.16.0',
22+
},
23+
},
2424
},
2525
{
2626
name: 'ember-release',
2727
npm: {
2828
devDependencies: {
29-
'ember-source': await getChannelURL('release')
30-
}
31-
}
29+
'ember-source': await getChannelURL('release'),
30+
},
31+
},
3232
},
3333
{
3434
name: 'ember-beta',
3535
npm: {
3636
devDependencies: {
37-
'ember-source': await getChannelURL('beta')
38-
}
39-
}
37+
'ember-source': await getChannelURL('beta'),
38+
},
39+
},
4040
},
4141
{
4242
name: 'ember-canary',
4343
npm: {
4444
devDependencies: {
45-
'ember-source': await getChannelURL('canary')
46-
}
47-
}
45+
'ember-source': await getChannelURL('canary'),
46+
},
47+
},
4848
},
4949
// The default `.travis.yml` runs this scenario via `npm test`,
5050
// not via `ember try`. It's still included here so that running
@@ -53,37 +53,37 @@ module.exports = async function() {
5353
{
5454
name: 'ember-default',
5555
npm: {
56-
devDependencies: {}
57-
}
56+
devDependencies: {},
57+
},
5858
},
5959
{
6060
name: 'ember-default-with-jquery',
6161
env: {
6262
EMBER_OPTIONAL_FEATURES: JSON.stringify({
63-
'jquery-integration': true
64-
})
63+
'jquery-integration': true,
64+
}),
6565
},
6666
npm: {
6767
devDependencies: {
68-
'@ember/jquery': '^0.5.1'
69-
}
70-
}
68+
'@ember/jquery': '^0.5.1',
69+
},
70+
},
7171
},
7272
{
7373
name: 'ember-classic',
7474
env: {
7575
EMBER_OPTIONAL_FEATURES: JSON.stringify({
7676
'application-template-wrapper': true,
7777
'default-async-observers': false,
78-
'template-only-glimmer-components': false
79-
})
78+
'template-only-glimmer-components': false,
79+
}),
8080
},
8181
npm: {
8282
ember: {
83-
edition: 'classic'
84-
}
85-
}
86-
}
87-
]
83+
edition: 'classic',
84+
},
85+
},
86+
},
87+
],
8888
};
8989
};

packages/ember/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"lint:hbs": "ember-template-lint .",
2424
"lint:js": "eslint . --cache --cache-location '../../eslintcache/'",
2525
"start": "ember serve",
26-
"test": "npm-run-all lint:* test:*",
26+
"test": "bash ./scripts/run_tests.sh",
2727
"test:ember": "ember test",
2828
"test:ember-compatibility": "ember try:each",
2929
"prepublishOnly": "ember ts:precompile",

packages/ember/scripts/run_tests.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# running compatibilty tests takes ~15 min on a 2019 2.6 GHz 6-Core Intel i7 16" MacBook Pro w 32 GB of RAM, vs ~25 sec
2+
# for the regular tests
3+
4+
if [[ $TRAVIS || $GITHUB_ACTIONS ]]; then
5+
echo "In CI - running tests against multiple versions of Ember"
6+
yarn npm-run-all lint:* test:*
7+
else
8+
echo "Tests running locally - will only run tests against default version of Ember"
9+
yarn npm-run-all lint:* test:ember
10+
fi

0 commit comments

Comments
 (0)