Closed Bug 1757040 Opened 7 months ago Closed 7 months ago

Provide add_setup which interacts correctly with `.only` and `.skip` in xpcshell tests

Categories

(Testing :: XPCShell Harness, defect, P3)

Default
Desktop
All
defect

Tracking

(firefox99 fixed)

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1720335 +++

Although we have registerCleanupFunction, we do not have an equivalent for test setup.

Right now .only() doesn't always work right, because it doesn't take into account setup tasks as, well, required setup.

If we had appropriate setup functions, this would work right.


bug 1720335 did this for browser mochitests; let's do the same for xpcshell.

Summary: Add setup abstraction that interacts correctly with `.only` and `.skip` to xpcshell tests → Provide add_setup which interacts correctly with `.only` and `.skip` in xpcshell tests
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/64ef1f73d033
add add_setup() primitive to xpcshell test framework, r=Standard8
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Blocks: 1757329
Blocks: 1776576

I just discovered that multiple add_setup invocations execute in reverse order. That is:

add_setup(a);
add_setup(b);

invokes as b(); a(). That surprised me. Should we either disallow multiple add_setup calls, or fix the ordering (and test that it stays consistent)?

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Nick Alexander :nalexander [he/him] from comment #4)

I just discovered that multiple add_setup invocations execute in reverse order. That is:

add_setup(a);
add_setup(b);

invokes as b(); a(). That surprised me. Should we either disallow multiple add_setup calls, or fix the ordering (and test that it stays consistent)?

We should fix the ordering. Please file a follow-up.

Is this happening for xpcshell, for browser mochitests, or both? (The implementations are different 😭)

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(nalexander)

(In reply to :Gijs (he/him) from comment #5)

(In reply to Nick Alexander :nalexander [he/him] from comment #4)

I just discovered that multiple add_setup invocations execute in reverse order. That is:

add_setup(a);
add_setup(b);

invokes as b(); a(). That surprised me. Should we either disallow multiple add_setup calls, or fix the ordering (and test that it stays consistent)?

We should fix the ordering. Please file a follow-up.

Is this happening for xpcshell, for browser mochitests, or both? (The implementations are different 😭)

Filed and fixed by :gijs. Huzzah!

Flags: needinfo?(nalexander)
You need to log in before you can comment on or make changes to this bug.