Skip to content

Commit

Permalink
feat(showcase): speed up tests in CI
Browse files Browse the repository at this point in the history
feat(showcase): speed up tests in CI
  • Loading branch information
aklkv committed Jun 28, 2024
1 parent 9bb5b3e commit 6b2f44f
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
working-directory: showcase
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_COMPONENTS }}
PERCY_PARALLEL_TOTAL: 8

try-scenarios:
name: ${{ matrix.try-scenario }}
Expand Down
14 changes: 14 additions & 0 deletions packages/components/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ import HdsCopyButton from './components/hds/copy/button/index.ts';
import HdsCopySnippet from './components/hds/copy/snippet/index.ts';
import HdsDisclosurePrimitive from './components/hds/disclosure-primitive/index.ts';
import HdsDismissButton from './components/hds/dismiss-button/index.ts';
import HdsDropdown from './components/hds/dropdown/index.ts';
import HdsFlyout from './components/hds/flyout/index.ts';
import HdsFormCharacterCount from './components/hds/form/character-count/index.js';
import HdsIconTile from './components/hds/icon-tile/index.ts';
import HdsInteractive from './components/hds/interactive/index.ts';
import HdsLinkInline from './components/hds/link/inline.ts';
import HdsLinkStandalone from './components/hds/link/standalone.ts';
import HdsMenuPrimitive from './components/hds/menu-primitive/index.ts';
import HdsModal from './components/hds/modal/index.ts';
import HdsPageHeader from './components/hds/page-header/index.ts';
import HdsPaginationCompact from './components/hds/pagination/compact/index.js';
import HdsPaginationNumbered from './components/hds/pagination/numbered/index.js';
import HdsReveal from './components/hds/reveal/index.ts';
import HdsSeparator from './components/hds/separator/index.ts';
import HdsStepperStepIndicator from './components/hds/stepper/step/indicator.ts';
Expand All @@ -49,11 +56,18 @@ export {
HdsCopySnippet,
HdsDisclosurePrimitive,
HdsDismissButton,
HdsDropdown,
HdsFlyout,
HdsFormCharacterCount,
HdsIconTile,
HdsInteractive,
HdsLinkInline,
HdsLinkStandalone,
HdsMenuPrimitive,
HdsModal,
HdsPageHeader,
HdsPaginationCompact,
HdsPaginationNumbered,
HdsReveal,
HdsSeparator,
HdsStepperStepIndicator,
Expand Down
5 changes: 3 additions & 2 deletions showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"lint:types": "glint",
"start": "yarn build:packages && ember serve",
"test": "concurrently \"yarn:lint\" \"yarn:test:*\" --names \"lint,test:\"",
"test:ember": "yarn build:packages && ember test",
"test:ember": "yarn build:packages && ember exam --split=8 --parallel",
"test:ember-compatibility": "ember try:each",
"test:ember:percy": "percy exec ember test",
"test:ember:percy": "percy exec -- ember exam --split=8 --parallel",
"test:a11y": "ENABLE_A11Y_AUDIT=true ember test --server",
"test:a11y-report": "ENABLE_A11Y_MIDDLEWARE_REPORTER=true ember test"
},
Expand Down Expand Up @@ -74,6 +74,7 @@
"ember-cli-terser": "^4.0.2",
"ember-concurrency": "^4.0.2",
"ember-deep-tracked": "^2.0.0",
"ember-exam": "^9.0.0",
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.1.0",
"ember-page-title": "^8.2.3",
Expand Down
3 changes: 3 additions & 0 deletions showcase/testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
'use strict';

module.exports = {
// setting parallel execution to -1 means auto-detect and use the maximum number of parallel processes possible
// while setting it to 1 means executing tests serially, one after the other
parallel: process.env.CI ? -1 : 1,
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
Expand Down
3 changes: 2 additions & 1 deletion showcase/tests/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import config from 'showcase/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';
// @ts-expect-error: there no types for this package
import start from 'ember-exam/test-support/start';
import {
DEFAULT_A11Y_TEST_HELPER_NAMES,
setRunOptions,
Expand Down
Loading

0 comments on commit 6b2f44f

Please sign in to comment.