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 @@ -132,6 +132,20 @@ void afterEach(Function fn) {
132
132
}
133
133
134
134
// For sharding across multiple instances of karma.
135
+ // _numKarmaShards values:
136
+ // 1: (default) Use one shard. (i.e. there's no sharding.)
137
+ // 0: No shards! So no tests are run. However, the preprocessors are still
138
+ // executed and the browsers are launched. This can be used to validate
139
+ // the configuration and browsers without running any tests.
140
+ // scripts/travis/build.sh uses this to run the preprocessors once to
141
+ // generate the dart2js output. It then runs the tests with multiple
142
+ // shards knowing that these shards will all use the dart2js output
143
+ // generated from the dummy run.
144
+ // > 1: Specifies that there are this many number of total karma shards. If
145
+ // there are N karma shards and T tests, then each shard runs about T/N
146
+ // tests. In this case, the _shardId - which must be [0, N) - indicates
147
+ // the current karma shard so we can select the appropriate subset of
148
+ // tests to run.
135
149
int _numShards = 1 ;
136
150
int _shardId = 0 ;
137
151
int _itCount = 0 ;
You can’t perform that action at this time.
0 commit comments