Uploaded image for project: 'Nuxeo Web UI'
  1. Nuxeo Web UI
  2. WEBUI-1253

Fix ftests error due to incompatible node version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.x, 3.1.x
    • Component/s: Test Framework

      Description

      Recently when running ftests stage for addons we received the following error that we want to fix:

      [2023-08-22T23:09:11.135Z] [INFO]      [exec] Execution of 3 workers started at 2023-08-22T23:09:10.888Z
      [2023-08-22T23:09:11.135Z] [INFO]      [exec] 2023-08-22T23:09:10.949Z ERROR @wdio/utils:initialiseServices: Error: Couldn't initialise "@wdio/selenium-standalone-service".
      [2023-08-22T23:09:11.135Z] [INFO]      [exec] /home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@puppeteer/browsers/lib/cjs/launch.js:36
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     options.platform ??= (0, detectPlatform_js_1.detectBrowserPlatform)();
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]                      ^^^
      [2023-08-22T23:09:11.135Z] [INFO]      [exec] SyntaxError: Unexpected token '??='
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at wrapSafe (internal/modules/cjs/loader.js:1029:16)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Module._compile (internal/modules/cjs/loader.js:1078:27)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Module._compile (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/pirates/lib/index.js:117:24)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Object.newLoader [as .js] (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/pirates/lib/index.js:121:7)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Module.load (internal/modules/cjs/loader.js:979:32)
      [2023-08-22T23:09:11.135Z] [INFO]      [exec]     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at Module.require (internal/modules/cjs/loader.js:1003:19)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at require (internal/modules/cjs/helpers.js:107:18)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at Object.<anonymous> (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@puppeteer/browsers/lib/cjs/main.js:19:19)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at safeRequire (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/utils/build/utils.js:192:15)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at initialisePlugin (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/utils/build/initialisePlugin.js:30:50)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at initialiseServices (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/utils/build/initialiseServices.js:59:56)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at initialiseLauncherService (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/utils/build/initialiseServices.js:86:26)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at Launcher.run (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/cli/build/launcher.js:73:103)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at launch (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/cli/build/commands/run.js:126:21)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at handler (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/cli/build/commands/run.js:165:16)
      [2023-08-22T23:09:11.136Z] [INFO]      [exec]     at Object.run (/home/jenkins/workspace/s_nuxeo-compound-documents_PR-37/nuxeo-compound-documents-web/node_modules/@wdio/cli/build/index.js:77:34)
      

      The issue is the following line in the puppeteer code, which doesn't work with node 14:

      options.platform ??= (0, detectPlatform_js_1.detectBrowserPlatform)();
      

      Accordding to NPM, the current version we download of puppeteer is the 1.7.0. According to this line https://github.com/puppeteer/puppeteer/commit/031b0217034ec161fc19b207013c727de274f49a#diff-8e01e5bf2a1332f403d9036f727d9e3db6ee8406b4b3430630160b086f59d0dfR109 the puppeteer code is probably compatible with node 16 only since May 2023.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: