Closed Bug 1575570 Opened 4 months ago Closed 4 months ago

node tests can't be run from existing documentation

Categories

(DevTools :: General, enhancement)

enhancement
Not set

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: ochameau, Assigned: jdescottes)

References

Details

Attachments

(2 files)

Bug 1571365 added some more information on how to run the node tests locally as well as on try. But this isn't yet enough to be able to run them.

The documentation suggests to run such command

> node devtools/client/bin/devtools-node-test-runner.js --suite={suitename}

But when I do that, I get:

$ node devtools/client/bin/devtools-node-test-runner.js --suite=webconsole
[devtools-node-test-runner] Extract suite argument
[devtools-node-test-runner] Found test suite: webconsole
[devtools-node-test-runner] Run `yarn` in test folder
/mnt/desktop/gecko-dev/devtools/client/bin/devtools-node-test-runner.js:63
  return { out: out.toString(), err: err && err.toString() };
                    ^

TypeError: Cannot read property 'toString' of null
    at execOut (/mnt/desktop/gecko-dev/devtools/client/bin/devtools-node-test-runner.js:63:21)
    at runTests (/mnt/desktop/gecko-dev/devtools/client/bin/devtools-node-test-runner.js:124:3)
    at Object.<anonymous> (/mnt/desktop/gecko-dev/devtools/client/bin/devtools-node-test-runner.js:157:20)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)

I imagine that I got this exception because yarn wasn't installed.
We should probably mention having to install yarn and refer to this page:
https://yarnpkg.com/docs/install/
And may be improve the test runner to fail gracefully if yarn isn't available?

Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29f5987dc935
Mention yarn in prerequisites for running devtools node tests r=ochameau
https://hg.mozilla.org/integration/autoland/rev/e18558240aab
Check if yarn is installed when running DevTools node tests r=ochameau
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Assignee: nobody → jdescottes
You need to log in before you can comment on or make changes to this bug.