Skip to content

Commit

Permalink
feat: add LTS 3.20 in the test suite (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatWizard authored Sep 28, 2020
1 parent f8dad07 commit bd314b8
Show file tree
Hide file tree
Showing 17 changed files with 1,670 additions and 1,311 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
node: circleci/node@2.1.1
node: circleci/node@4.0.1

defaults: &defaults
docker:
Expand All @@ -16,9 +16,11 @@ jobs:
- checkout
- node/install-packages:
pkg-manager: "yarn"
cache-key: "yarn.lock"
cache-version: "v1"
include-branch-in-cache-key: false
- run:
name: Generate reports folder
command: mkdir reports
- persist_to_workspace:
root: .
paths:
Expand All @@ -29,6 +31,9 @@ jobs:
steps:
- attach_workspace:
at: .
- run:
name: Lint Handlebars
command: yarn lint:hbs
- run:
name: Lint JavaScript
command: yarn lint:js
Expand All @@ -41,9 +46,13 @@ jobs:
- run:
name: Run Tests
command: yarn test:ember
- store_test_results:
path: "reports"
- store_artifacts:
path: "reports"

workflows:
workflow:
build_and_test:
jobs:
- prepare
- lint:
Expand Down
8 changes: 2 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ module.exports = {
env: {
browser: true
},
rules: {
'ember/no-jquery': 'error'
},
rules: {},
overrides: [
// node files
{
Expand Down Expand Up @@ -50,9 +48,7 @@ module.exports = {
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
extends: ['plugin:node/recommended']
}
]
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ It will provides a `test_and_build` workflow, as follows:

It will provides a `test_matrix` workflow, as follows:

![prepare / run lint (js and hbs) and tests (default) / run tests (LTS 3.12, LTS 3.16, release, beta, canary, default with jquery and classic)](https://raw.githubusercontent.com/GreatWizard/ember-circleci/master/doc/workflow-addon.png)
![prepare / run lint (js and hbs) and tests (default) / run tests (LTS 3.12, LTS 3.16, LTS 3.20, release, beta, canary, default with jquery and classic)](https://raw.githubusercontent.com/GreatWizard/ember-circleci/master/doc/workflow-addon.png)

## Contributing

Expand Down
35 changes: 28 additions & 7 deletions blueprints/ember-circleci/files/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
node: circleci/node@2.1.1
node: circleci/node@4.0.1

defaults: &defaults
docker:
Expand All @@ -15,8 +15,7 @@ jobs:
steps:
- checkout
- node/install-packages:
<% if (yarn) { %> pkg-manager: "yarn"
cache-key: "yarn.lock"<% } %>
<% if (yarn) { %> pkg-manager: "yarn"<% } %>
cache-version: "v1"
include-branch-in-cache-key: false
<% if (exam && !addon) { %> - run:
Expand Down Expand Up @@ -51,6 +50,7 @@ jobs:
[
"lts-3.12",
"lts-3.16",
"lts-3.20",
"release",
"beta",
"canary",
Expand All @@ -64,10 +64,25 @@ if (exam) { %> parallelism: <%= parallel %>
<% } %> steps:
- attach_workspace:
at: .
- run:
name: Run <% if (addon) { %><< parameters.scenario >> <% } %>Tests
command: <% if (addon) { if (yarn) { %>yarn<% } else { %>npx<% } %> ember try:one ember-<< parameters.scenario >> --skip-cleanup=true<% } else if (exam) { if (yarn) { %>yarn<% } else { %>npx<% } %> ember exam --path=dist --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` --parallel --load-balance<% } else if (yarn) { %>yarn test:ember<% } else { %>npm run test:ember<% } %>
<% if (exam === false) { %> - store_test_results:
<% if (addon) { %> - when:
condition:
equal: [ "default", << parameters.scenario >> ]
steps:
- run:
name: Run << parameters.scenario >> Tests
command: <% if (yarn) { %>yarn<% } else { %>npm run<% } %> test:ember
- when:
condition:
not:
equal: [ "default", << parameters.scenario >> ]
steps:
- run:
name: Run << parameters.scenario >> Tests
command: <% if (yarn) { %>yarn <% } else { %>npm <% } %><% if (addon) { %>ember try:one ember-<< parameters.scenario >> --skip-cleanup=true<% } else if (exam) { %>ember exam --path=dist --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` --parallel --load-balance<% } else if (yarn) { %>test:ember<% } else { %>run test:ember<% } %>
<% } else { %> - run:
name: Run Tests
command: <% if (yarn) { %>yarn <% } else { %>npm <% } %><% if (exam) { %>ember exam --path=dist --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` --parallel --load-balance<% } else { if (!yarn) { %>run <% } %>test:ember<% } %>
<% } if (exam === false) { %> - store_test_results:
path: "reports"
- store_artifacts:
path: "reports"
Expand All @@ -94,6 +109,12 @@ workflows:
requires:
- lint
- test
- test:
name: test_lts_3_20
scenario: lts-3.20
requires:
- lint
- test
- test:
name: test_release
scenario: release
Expand Down
17 changes: 9 additions & 8 deletions blueprints/ember-circleci/files/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ if (yarn) { %> useYarn: true,
}
}
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.5'
}
}
},
{
name: 'ember-release',
npm: {
Expand All @@ -44,19 +52,12 @@ if (yarn) { %> useYarn: true,
},
{
name: 'ember-canary',
allowedToFail: true,
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-default-with-jquery',
env: {
Expand All @@ -66,7 +67,7 @@ if (yarn) { %> useYarn: true,
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
'@ember/jquery': '^1.1.0'
}
}
},
Expand Down
48 changes: 26 additions & 22 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,86 @@
"use strict";
'use strict';

const getChannelURL = require("ember-source-channel-url");
const getChannelURL = require('ember-source-channel-url');
const isCI = !!process.env.CI;

module.exports = async function() {
return {
command: isCI ? 'ember test --silent --reporter xunit > ./reports/test_results.xml' : 'ember test',
useYarn: true,
scenarios: [
{
name: "ember-lts-3.12",
name: 'ember-lts-3.12',
npm: {
devDependencies: {
"ember-source": "~3.12.0"
'ember-source': '~3.12.0'
}
}
},
{
name: "ember-lts-3.16",
name: 'ember-lts-3.16',
npm: {
devDependencies: {
"ember-source": "~3.16.0"
'ember-source': '~3.16.0'
}
}
},
{
name: "ember-release",
name: 'ember-lts-3.20',
npm: {
devDependencies: {
"ember-source": await getChannelURL("release")
'ember-source': '~3.20.5'
}
}
},
{
name: "ember-beta",
name: 'ember-release',
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta")
'ember-source': await getChannelURL('release')
}
}
},
{
name: "ember-canary",
name: 'ember-beta',
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary")
'ember-source': await getChannelURL('beta')
}
}
},
{
name: "ember-default",
name: 'ember-canary',
npm: {
devDependencies: {}
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
},
{
name: "ember-default-with-jquery",
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true
'jquery-integration': true
})
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1"
'@ember/jquery': '^1.1.0'
}
}
},
{
name: "ember-classic",
name: 'ember-classic',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false
})
},
npm: {
ember: {
edition: "classic"
edition: 'classic'
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
'use strict';

module.exports = function(/* environment, appConfig */) {
return {};
return { };
};
Binary file modified doc/workflow-addon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/workflow-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"ember-cli-babel": "^7.19.0",
"ember-cli-htmlbars": "^4.3.1"
"ember-cli-babel": "^7.21.0",
"ember-cli-htmlbars": "^5.2.0"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.5.3",
"ember-cli": "~3.18.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.20.2",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
Expand All @@ -49,13 +49,12 @@
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.18.0",
"ember-source": "~3.20.2",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.6.0",
"ember-template-lint": "^2.9.1",
"ember-try": "^1.4.0",
"ember-welcome-page": "^4.0.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^8.4.0",
"eslint": "^7.5.0",
"eslint-plugin-ember": "^8.9.1",
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
Expand Down
29 changes: 16 additions & 13 deletions testem.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
const lint = process.env.CI ? "nolint" : "";
const testParams = ["hidepassed", lint].filter(Boolean).join("&");
const lint = process.env.CI ? 'nolint' : '';
const testParams = ['hidepassed', lint].filter(Boolean).join('&');

module.exports = {
parallel: -1,
test_page: `tests/index.html?${testParams}`,
disable_watching: true,
launch_in_ci: ["Chrome"],
launch_in_dev: ["Chrome"],
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? "--no-sandbox" : null,
"--headless",
"--disable-dev-shm-usage",
"--disable-software-rasterizer",
"--mute-audio",
"--remote-debugging-port=0",
"--window-size=1440,900"
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900'
].filter(Boolean)
},
Firefox: {
ci: ["-headless", "--window-size=1440,900"].filter(Boolean)
ci: ['-headless', '--window-size=1440,900'].filter(Boolean)
}
}
};
Loading

0 comments on commit bd314b8

Please sign in to comment.