Run mocha tests with TaskCluster



2 years ago
2 months ago


(Reporter: linclark, Unassigned)


(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)



(1 attachment)



2 years ago
We have unit tests that require Node so that we can use mocha and Enzyme. We should run these in CI.

How to run them:

- cd devtools/client/webconsole
- npm install
- npm test

Comment 1

2 years ago
Alex, if you can help us get started with TaskCluster, that would be great. The test commands are above.
Flags: needinfo?(poirot.alex)
I imagine there is an additional parameters to specify where firefox binary lives?

Could we get them running via ./mach somehow?
I don't know about node/npm I don't see any existing taskcluster task using that.
I'm not sure that's available in existing docker images.
We can surely come up with our own docker image, but I never did that and don't known what it takes to create and use a new one.

Taskcluster is somewhat easy. All the scripts live here:

So. To introduce a new test runner, it is as simple as editing:
And copy for example the "mochitest" section into a "devtools-console" one.
Here is a tweaked example, where I replaced the usage of the magic "mozharness" thing, which is a super helper made in python to run stuff around firefox. Instead it uses a "run-task" rule that allows arbitrary command execution.

    description: "Devtools console unit tests"
    suite: devtools/console
    treeherder-symbol: tc-Dt-c()
    loopback-video: true
    max-run-time: 5400
        using: run-task
        command: >
            cd /home/worker/checkouts/gecko/devtools/client/webconsole &&
            wget -O build.tar.bz2 {{build_url}} &&
            tar jxvf build.tar.bz2 && # if that {{build_url}} thing still works, you should have firefox here: ./firefox/firefox-bin
            npm install &&
            npm test
    instance-size: legacy
    allow-software-gl-layers: false

(I don't know what some fields are about and just keep them from mochitest rule)

Then you would have to register this new test rule in this file:

There is some docs over there:

You may find valuable help on #taskcluster if the right people are online when you are asking for help.
Flags: needinfo?(poirot.alex)


2 years ago
Priority: -- → P2
Blocks: 1308219
Flags: qe-verify-
Whiteboard: [new-console]
Priority: P2 → P1
Priority: P1 → P2


2 years ago
Assignee: nobody → nchevobbe
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Iteration: --- → 55.4 - May 1
Priority: P2 → P1
Whiteboard: [new-console] → [console-html]
Iteration: 55.4 - May 1 → 55.5 - May 15
Iteration: 55.5 - May 15 → 55.6 - May 29
Assignee: nchevobbe → nobody
Iteration: 55.6 - May 29 → ---
Priority: P1 → P3
Whiteboard: [console-html] → [reserve-console-html]
Priority: P3 → P4
Depends on: 1401189
Priority: P4 → P3
Priority: P3 → P2
Whiteboard: [reserve-console-html] → [newconsole-mvp]
Flags: qe-verify-
Priority: P2 → --
Whiteboard: [newconsole-mvp]


6 months ago
Product: Firefox → DevTools


5 months ago
Priority: -- → P2
Duplicate of this bug: 1499657
You need to log in before you can comment on or make changes to this bug.