Skip to content

Commit 6e7ec27

Browse files
filipesilvaKeen Yee Liau
authored and
Keen Yee Liau
committed
ci: add flake jail
1 parent 6e9514b commit 6e7ec27

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.circleci/config.yml

+13
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ jobs:
241241
- attach_workspace: *attach_options
242242
- run: yarn build
243243

244+
# This is where we put all the misbehaving and flaky tests so we can fine-tune their conditions
245+
# and rerun them faster.
246+
flake-jail:
247+
executor: action-executor
248+
steps:
249+
- attach_workspace: *attach_options
250+
- run: yarn webdriver-update
251+
- run: yarn test-large --full --flakey
252+
- run: yarn test-large --full --flakey --ivy=true
253+
244254
build-bazel:
245255
executor: action-executor
246256
resource_class: xlarge
@@ -379,6 +389,9 @@ workflows:
379389
- test-browsers:
380390
requires:
381391
- build
392+
- flake-jail:
393+
requires:
394+
- build
382395
- snapshot_publish:
383396
<<: *ignore_pull_requests
384397
requires:

scripts/test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ import { packages } from '../lib/packages';
2222
const codeMap = require('../lib/istanbul-local').codeMap;
2323
const Jasmine = require('jasmine');
2424

25+
const knownFlakes = [
26+
// Rebuild tests in test-large are flakey if not run as the first suite.
27+
// https://github.com/angular/angular-cli/pull/15204
28+
'packages/angular_devkit/build_angular/test/browser/rebuild_spec_large.ts',
29+
];
30+
2531
const projectBaseDir = join(__dirname, '..');
2632
require('source-map-support').install({
2733
hookRequire: true,
@@ -265,6 +271,9 @@ export default function(args: ParsedArgs, logger: logging.Logger) {
265271
}
266272
}
267273

274+
// Filter in/out flakes according to the --flakey flag.
275+
tests = tests.filter(test => !!args.flakey == knownFlakes.includes(test.replace(/[\/\\]/g, '/')));
276+
268277
if (args.shard !== undefined) {
269278
// Remove tests that are not part of this shard.
270279
const shardId = args['shard'];

0 commit comments

Comments
 (0)