This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -123,9 +123,9 @@ _run_karma_tests() {(
123
123
export -f _run_once
124
124
125
125
if [[ $TESTS == " dart2js" ]]; then
126
+ # Ref: test/_specs.dart: _numKarma shards.
126
127
# Prime the dart2jsaas cache.
127
128
NUM_KARMA_SHARDS=0 BROWSERS=SL_Chrome _run_once 0
128
-
129
129
# Run sharded karma tests.
130
130
export NUM_KARMA_SHARDS=4
131
131
seq 0 $(( NUM_KARMA_SHARDS- 1 )) | xargs -n 1 -P $NUM_KARMA_SHARDS -I SHARD_ID \
Original file line number Diff line number Diff line change @@ -133,6 +133,20 @@ void afterEach(Function fn) {
133
133
}
134
134
135
135
// For sharding across multiple instances of karma.
136
+ // _numKarmaShards values:
137
+ // 1: (default) Use one shard. (i.e. there's no sharding.)
138
+ // 0: No shards! So no tests are run. However, the preprocessors are still
139
+ // executed and the browsers are launched. This can be used to validate
140
+ // the configuration and browsers without running any tests.
141
+ // scripts/travis/build.sh uses this to run the preprocessors once to
142
+ // generate the dart2js output. It then runs the tests with multiple
143
+ // shards knowing that these shards will all use the dart2js output
144
+ // generated from the dummy run.
145
+ // > 1: Specifies that there are this many number of total karma shards. If
146
+ // there are N karma shards and T tests, then each shard runs about T/N
147
+ // tests. In this case, the _shardId - which must be [0, N) - indicates
148
+ // the current karma shard so we can select the appropriate subset of
149
+ // tests to run.
136
150
int _numShards = 1 ;
137
151
int _shardId = 0 ;
138
152
int _itCount = 0 ;
You can’t perform that action at this time.
0 commit comments