Closed Bug 1521752 Opened 5 years ago Closed 5 years ago

Add test for toolbox's DebugTargetInfo component

Categories

(DevTools :: about:debugging, enhancement, P1)

enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: ladybenko, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

We need to test that the DebugTargetInfo in the toolbox renders the right information according to UX specs (see: https://mozilla.invisionapp.com/share/7BPLWRTPKCH#/)

Priority: -- → P2
Assignee: nobody → dakatsuka
Status: NEW → ASSIGNED
Priority: P2 → P1
Assignee: dakatsuka → nobody
Status: ASSIGNED → NEW
Priority: P1 → P2

The goal of this bug is to write a UI unit test using Jest, to avoid having to setup a complex mochitests.
In our codebase today, only the debugger has Jest unit tests written I believe. They are currently working on running them on try.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: P2 → P1

This is more of a feedback request, I have not really written component unit tests before.

Depends on D24145. Just attaching for now as a POC. Will discuss on the bug to see how we want to organize this.

Some questions for Andrew and Jason about running additional Jest tests on try:

We are adding a new Jest test in devtools, outside of the debugger/ directory. For now I haven't really tried to merge this at all with what is done for the debugger. In https://phabricator.services.mozilla.com/D24146, I added another CI task to run this other test, similar to the debugger one.

I imagine we want to limit the number of tasks here? Should we aim for:

  • a single task that runs all DevTools tests (debugger tests/flow/lint included)
  • keep Debugger and DevTools tasks separated

Since the debugger is still developed both in m-c and Github, maybe the second option is preferable?

We should also start thinking about how we organize our package.json files inside /devtools as more panels will start writing Jest tests. But I think this can wait for a follow up.

Flags: needinfo?(jlaster)
Flags: needinfo?(ahal)

I would prefer keeping the debugger and devtools separate for now.

  1. our runner/reporter needs some work (https://bugzilla.mozilla.org/show_bug.cgi?id=1535113)
  2. the debugger jest tests have some interesting config (see jest.config.js), which include the babel step

There is nothing keeping us from consolidating this in the future.

Flags: needinfo?(jlaster)

Another benefit of keeping them separate is that the tasks are set to run only when certain files change, so we can run fewer tests this way (though setup/teardown might negate some of this). I don't think we need to worry about limiting tasks too much.

Otherwise I don't really have much of a preference here.

Flags: needinfo?(ahal)

Thanks for the feedback! Happy to keep debugger & devtools separate for now. Will update the patch shortly.

Additional question: I am trying to add a small developer documentation. I know how to select the debugger/devtools jest tests when pushing to try via ./mach try fuzzy. But I don't know how to do it when using the classic try syntax? Any idea?

Flags: needinfo?(ahal)

Depends on D24146. We are adding new devtools unit tests using jest.
They share a list of globals made available in the environment by Jest, so using a shared eslintrc would make sense here.

Attachment #9053289 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/93e944fe7234
Add jest test for framework component DebugTargetInfo;r=ladybenko
https://hg.mozilla.org/integration/autoland/rev/2aea0bb2df47
Run other DevTools jest tests on try;r=jlast,ahal
https://hg.mozilla.org/integration/autoland/rev/188ea7716008
Create jest test for aboutdebugging-new Message component;r=ladybenko

No, I'm not sure what the syntax is. I think you'd have to use the largely unknown -j option.

Flags: needinfo?(ahal)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
https://hg.mozilla.org/projects/ash/rev/93e944fe7234e57f5ff59ea9e84231924c863c05
Bug 1521752 - Add jest test for framework component DebugTargetInfo;r=ladybenko

https://hg.mozilla.org/projects/ash/rev/2aea0bb2df47f349364638e691d481a26c0f9f70
Bug 1521752 - Run other DevTools jest tests on try;r=jlast,ahal

https://hg.mozilla.org/projects/ash/rev/188ea77160086a0c99044485d7834c27b185103c
Bug 1521752 - Create jest test for aboutdebugging-new Message component;r=ladybenko
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: