Closed Bug 1085729 Opened 5 years ago Closed 5 years ago

--start-at and --end-at options broken for mochitests

Categories

(Testing :: Mochitest, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: billm, Assigned: billm)

Details

Attachments

(2 files)

Attached patch fix-start-atSplinter Review
Something seems to have changed here. This patch fixes the problem.
Attachment #8508359 - Flags: review?(jmaher)
Comment on attachment 8508359 [details] [diff] [review]
fix-start-at

Review of attachment 8508359 [details] [diff] [review]:
-----------------------------------------------------------------

this will work for the regular case, but not for android or some other corner cases with the old manifest format.

::: testing/mochitest/chunkifyTests.js
@@ +71,5 @@
>  function skipTests(tests, startTestPattern, endTestPattern) {
>    var startIndex = 0, endIndex = tests.length - 1;
>    for (var i = 0; i < tests.length; ++i) {
> +    var test_path;
> +    if ('test' in tests[i]) {

I would verifiy tests[i] is of a type object:
http://dxr.mozilla.org/mozilla-central/source/testing/mochitest/manifestLibrary.js#105

@@ +74,5 @@
> +    var test_path;
> +    if ('test' in tests[i]) {
> +      test_path = tests[i]['test']['url'];
> +    } else {
> +      test_path = tests[i]['url'];

I believe this else condition should be:
test_path = tests[i];

do let me know if you have other evidence.
Attachment #8508359 - Flags: review?(jmaher) → review-
I copied this chunk of code from chunkifyTests, which runs on essentially the same data as skipTests. If my patch is wrong, then I think they're both broken.

I started trying to trace through where the data comes from but I gave up.
Comment on attachment 8508359 [details] [diff] [review]
fix-start-at

ok, I went back and looked at this.  It worked fine for me locally and we are almost done deprecating the old format (active work has been done this week in bug 1083347).  Apologies for the confusion.
Attachment #8508359 - Flags: review- → review+
Attached patch skiptests.patchSplinter Review
In bug 1089771, I have made changes to chunkifyTests function, and I think we need to do the same for the skipTests function. Attaching a similar patch for it.

:billm, could you upload the patch that uses --start-at and --end-at, so that we can push to try and see if it works fine.
These two patches were basically the same so I just landed Vaibhav's.

There aren't any uses of --start-at or --end-at in the tree. It's just a command line option for running tests.
https://hg.mozilla.org/mozilla-central/rev/cb2065b39352
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.