Run mocha tests with TaskCluster

NEW
Unassigned

Status

P2
normal
2 years ago
2 months ago

People

(Reporter: linclark, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

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
(Reporter)

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:
http://searchfox.org/mozilla-central/source/taskcluster/ci/

So. To introduce a new test runner, it is as simple as editing:
http://searchfox.org/mozilla-central/source/taskcluster/ci/desktop-test/tests.yml
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.

devtools-console:
    description: "Devtools console unit tests"
    suite: devtools/console
    treeherder-symbol: tc-Dt-c()
    loopback-video: true
    max-run-time: 5400
    run:
        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:
http://searchfox.org/mozilla-central/source/taskcluster/ci/desktop-test/test-sets.yml#12

There is some docs over there:
http://searchfox.org/mozilla-central/source/taskcluster/docs

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

Updated

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

Updated

2 years ago
Assignee: nobody → nchevobbe
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Status: NEW → ASSIGNED
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
Status: ASSIGNED → NEW
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]

Updated

6 months ago
Product: Firefox → DevTools

Updated

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.