Skip to content

Commit 79de2c6

Browse files
Add documentation for preserveTestName
1 parent 7806b0e commit 79de2c6

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The [documentation website](https://ember-cli.github.io/ember-exam/) contains ex
2424
+ [Split Test Parallelization](#split-test-parallelization)
2525
* [Test Load Balancing](#test-load-balancing)
2626
- [Test Failure Reproduction](#test-failure-reproduction)
27+
* [Preserve Test Name](#preserve-test-name)
2728
- [Advanced Configuration](#advanced-configuration)
2829
* [Ember Try & CI Integration](#ember-try--ci-integration)
2930
* [Test Suite Segmentation](#test-suite-segmentation)
@@ -375,6 +376,33 @@ $ ember exam --replay-execution=test-execution-000000.json
375376
3. You must be using `qunit` version 2.8.0 or greater for this feature to work properly.
376377
4. This feature is not currently supported by Mocha.
377378

379+
#### Preserve Test Name
380+
381+
When using `--split` and/or `--load-balance` the output will look something like:
382+
383+
```bash
384+
# ember exam --split=2 --partition=1 --parallel=3 --load-balance
385+
ok 1 Chrome 66.0 - Exam Partition 1 - browser Id 1 - some test
386+
ok 2 Chrome 66.0 - Exam Partition 1 - browser Id 2 - another test
387+
ok 3 Chrome 66.0 - Exam Partition 1 - browser Id 3 - some the other test
388+
```
389+
However, if you change the amount of parallelization, or randomize across partitions, the output will change for the same test, which may be an issue if you are tracking test insights over time.
390+
391+
```bash
392+
# ember exam --split=2 --partition=1 --parallel=2 --load-balance
393+
ok 1 Chrome 66.0 - Exam Partition 1 - browser Id 2 - some test
394+
ok 2 Chrome 66.0 - Exam Partition 1 - browser Id 1 - another test
395+
ok 3 Chrome 66.0 - Exam Partition 1 - browser Id 2 - some the other test
396+
```
397+
You can add `--preserve-test-name` to remove the dynamic segments of the output (partition and browser) to ensure the output test names are always the same.
398+
399+
```bash
400+
# ember exam --split=2 --partition=1 --parallel=3 --load-balance --preserve-test-name
401+
ok 1 Chrome 66.0 - some test
402+
ok 2 Chrome 66.0 - another test
403+
ok 3 Chrome 66.0 - some the other test
404+
```
405+
378406
## Advanced Configuration
379407

380408
Ember Exam does its best to allow you to run your test suite in a way that is effective for your individual needs. To that end, there are lots of advanced ways to configure your setup by integrating with other aspects of the Ember testing environment. The following sections will cover a few of the more common scenarios.

tests/dummy/app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Router.map(function () {
1515
this.route('split-parallel');
1616
this.route('filtering');
1717
this.route('load-balancing');
18+
this.route('preserve-test-name');
1819

1920
this.route('ember-try-and-ci');
2021
this.route('test-suite-segmentation');

tests/dummy/app/templates/docs.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
{{nav.item "Split Test Parallelization" "docs.split-parallel"}}
1414
{{nav.item "Filtering" "docs.filtering"}}
1515
{{nav.item "Test Load Balancing" "docs.load-balancing"}}
16+
{{nav.item "Preserve Test Name" "docs.preserve-test-name"}}
1617

1718
{{nav.section "Advanced Configuration"}}
1819
{{nav.item "Ember Try & CI Integration" "docs.ember-try-and-ci"}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Preserve Test Name
2+
3+
When using `--split` and/or `--load-balance` the output will look something like:
4+
5+
```bash
6+
# ember exam --split=2 --partition=1 --parallel=3 --load-balance
7+
ok 1 Chrome 66.0 - Exam Partition 1 - browser Id 1 - some test
8+
ok 2 Chrome 66.0 - Exam Partition 1 - browser Id 2 - another test
9+
ok 3 Chrome 66.0 - Exam Partition 1 - browser Id 3 - some the other test
10+
```
11+
However, if you change the amount of parallelization, or randomize accross partitions, the output will change for the same test, which may be an issue if you are tracking test insights over time.
12+
13+
```bash
14+
# ember exam --split=2 --partition=1 --parallel=2 --load-balance
15+
ok 1 Chrome 66.0 - Exam Partition 1 - browser Id 2 - some test
16+
ok 2 Chrome 66.0 - Exam Partition 1 - browser Id 1 - another test
17+
ok 3 Chrome 66.0 - Exam Partition 1 - browser Id 2 - some the other test
18+
```
19+
You can add `--preserve-test-name` to remove the dynamic segments of the output (partition and browser) to ensure the output test names are always the same.
20+
21+
```bash
22+
# ember exam --split=2 --partition=1 --parallel=3 --load-balance --preserve-test-name
23+
ok 1 Chrome 66.0 - some test
24+
ok 2 Chrome 66.0 - another test
25+
ok 3 Chrome 66.0 - some the other test
26+
```

0 commit comments

Comments
 (0)