Closed Bug 1546370 Opened 8 months ago Closed 8 months ago

[remote-dbg-next] fix jest test failing on try due to not supported node version (+10)

Categories

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

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: ogasidlo, Assigned: ogasidlo)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [remote-debugging-reserve] remote-debugging-technical-debt)

Attachments

(1 file)

Jest tests are failing on try due to not supported node version.
https://treeherder.mozilla.org/logviewer.html#?job_id=242008678&repo=autoland&lineNumber=275

We'll decided to back out this change and document here how to fix it in the future when we support Node >=10 on try.

To make sure, we do not need to solve this issue again, I'll document the fix here.

=========== PROGRESS + FIX ===========

The initial issue was following:
When trying to run the jest test with yarn test, await could not be parsed.

Our fluent-react package was causing this as the message component is using fluent, so did also the related jest test.

~/mozilla-central/devtools/client/shared/vendor/fluent.js: Unexpected token, expected ( (1996:8)

        1994 | async function mapContextAsync(iterable, ids) {
        1995 |   if (!Array.isArray(ids)) {
      > 1996 |     for await (const context of iterable) {
             |         ^
        1997 |       if (context.hasMessage(ids)) {
        1998 |         return context;
        1999 |       }

This is why a syntax-plugin for babel was added and the Node as well as Jest version bumped.

https://searchfox.org/mozilla-central/source/devtools/client/aboutdebugging-new/test/jest/package.json
"node": ">=8.9.4" -> "node": ">=10.0.0"
"jest": "^23.0.0", -> "jest": "^24.6.0",

"devDependencies": {
    "babel-plugin-transform-async-generator-functions": "^6.24.1"
  }

To make sure, babel is able to use the syntax plugin, a .babelrc was created and the plugin registered.

{
    "plugins": ["syntax-async-generators"]
}
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: remote-debugging-technical-debt → [remote-debugging-reserve] remote-debugging-technical-debt

Revert Node + Jest version bump as try is not supporting node >=10

Duplicate of this bug: 1546337
Pushed by ogasidlo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d29767eb7247
Revert Node + Jest version bump r=jdescottes,ladybenko
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Status: RESOLVED → REOPENED
Depends on: 1547823
Resolution: FIXED → ---
Summary: [remote-dbg-next] jest test failing on try due to not supported node version (+10) → [remote-dbg-next] fix jest test failing on try due to not supported node version (+10)
Status: REOPENED → ASSIGNED

Let's use follow up bugs. We have no idea when/if the newly filed bug will be resolved.
The goal here was to fix the jest tests running on try. This has been achieved, patches have landed, so let's keep this bug closed.

New work should be tracked in new bugs.

Status: ASSIGNED → RESOLVED
Closed: 8 months ago8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.