Skip to content

Commit

Permalink
Adding a Docker script and prompt for Cypress a11y tests in CI. (elas…
Browse files Browse the repository at this point in the history
  • Loading branch information
1Copenut authored Nov 9, 2022
1 parent 56f4c93 commit cae53d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"scripts": {
"start": "cross-env BABEL_MODULES=false webpack serve --config=src-docs/webpack.config.js",
"test-docker": "node ./scripts/test-docker.js",
"test-a11y-docker": "node ./scripts/test-a11y-docker.js",
"sync-docs": "node ./scripts/docs-sync.js",
"build-docs": "cross-env BABEL_MODULES=false cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 webpack --config=src-docs/webpack.config.js",
"build": "yarn extract-i18n-strings && node ./scripts/compile-clean.js && node ./scripts/compile-eui.js && yarn compile-scss",
Expand Down
20 changes: 20 additions & 0 deletions scripts/test-a11y-docker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { execSync } = require('child_process');

execSync('docker pull docker.elastic.co/eui/ci:3.3', {
stdio: 'inherit',
});
/* eslint-disable-next-line no-multi-str */
execSync(
'docker run \
-i --rm --cap-add=SYS_ADMIN --volume=$(pwd):/app --workdir=/app \
-e GIT_COMMITTER_NAME=test -e GIT_COMMITTER_EMAIL=test -e HOME=/tmp \
--user=$(id -u):$(id -g) \
docker.elastic.co/eui/ci:3.3 \
bash -c \'npm config set spin false \
&& /opt/yarn*/bin/yarn \
&& yarn cypress install \
&& NODE_OPTIONS="--max-old-space-size=2048" npm run test-cypress-a11y\'',
{
stdio: 'inherit',
}
);

0 comments on commit cae53d2

Please sign in to comment.