diff --git a/.circleci/config.yml b/.circleci/config.yml index 886c08b5cb23..f89def943887 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,9 @@ jobs: steps: - attach_workspace: *attach_options - run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} + - store_artifacts: + path: /tmp/dist + destination: cli/new-production e2e-node-8: <<: *defaults diff --git a/.github/angular-robot.yml b/.github/angular-robot.yml index ca9d26f7dd2d..2ebaf76633ef 100644 --- a/.github/angular-robot.yml +++ b/.github/angular-robot.yml @@ -91,3 +91,8 @@ triage: - - "type: docs" - "comp: *" + +# Size checking +size: + circleCiStatusName: "ci/circleci: e2e-cli" + maxSizeIncrease: 10000 diff --git a/tests/legacy-cli/e2e/tests/basic/build.ts b/tests/legacy-cli/e2e/tests/basic/build.ts index 36ad2f6b68fc..4473ca62d94f 100644 --- a/tests/legacy-cli/e2e/tests/basic/build.ts +++ b/tests/legacy-cli/e2e/tests/basic/build.ts @@ -1,9 +1,20 @@ -import {ng} from '../../utils/process'; -import {expectFileToMatch} from '../../utils/fs'; - -export default function() { - return ng('build') - .then(() => expectFileToMatch('dist/test-project/index.html', 'main.js')) - .then(() => ng('build', '--prod')) - .then(() => expectFileToMatch('dist/test-project/index.html', /main\.[a-zA-Z0-9]{20}\.js/)); +import { expectFileToMatch, moveDirectory } from '../../utils/fs'; +import { ng } from '../../utils/process'; + + +export default async function() { + // Development build + await ng('build'); + await expectFileToMatch('dist/test-project/index.html', 'main.js'); + + + // Production build + await ng('build', '--prod'); + await expectFileToMatch('dist/test-project/index.html', /main\.[a-zA-Z0-9]{20}\.js/); + + // Store the production build for artifact storage on CircleCI + if (process.env['CIRCLECI']) { + await ng('build', '--prod', '--output-hashing=none'); + await moveDirectory('dist', '/tmp/dist'); + } } diff --git a/tests/legacy-cli/e2e/utils/fs.ts b/tests/legacy-cli/e2e/utils/fs.ts index 13d424e81f17..2f2a0cdaae77 100644 --- a/tests/legacy-cli/e2e/utils/fs.ts +++ b/tests/legacy-cli/e2e/utils/fs.ts @@ -107,6 +107,10 @@ export function copyFile(from: string, to: string) { })); } +export function moveDirectory(from: string, to: string) { + return fs.move(from, to, { overwrite: true }); +} + export function writeMultipleFiles(fs: { [path: string]: string }) { return Promise.all(Object.keys(fs).map(fileName => writeFile(fileName, fs[fileName])));