Problem/Motivation

In 10.x we are currently on Nightwatch 2.1.3 but the latest version is 2.4.1.

Note: 9.5.x is on Nightwatch 1.7.13, which is the latest release on the 1.x branch. No changes needed there.

Steps to reproduce

Proposed resolution

Update to Nightwatch 2.4.1 on Drupal 10.0.x.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3306446

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

$ yarn-lock-diff -o old.yarn.lock -n yarn.lock
┌──────────────────────────────┬────────────────┬─────────────────────┐
│ package name                 │ old version(s) │ new version(s)      │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ @nightwatch/ejs              │ 3.2.0          │ -                   │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ cli-spinners                 │ [...]          │ [..., 2.7.0]        │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ glob                         │ [...], 8.0.3   │ [..., 8.0.3], 7.2.3 │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ jszip                        │ 3.9.1          │ 3.10.1              │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ nightwatch                   │ 2.1.4          │ 2.3.3               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ selenium-webdriver           │ 4.1.1          │ 4.4.0               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ ansi-to-html                 │ -              │ 0.7.2               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ async                        │ -              │ 3.2.4               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ define-lazy-prop             │ -              │ 2.0.0               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ ejs                          │ -              │ 3.1.8               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ filelist                     │ -              │ 1.0.4               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ is-docker                    │ -              │ 2.2.1               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ is-wsl                       │ -              │ 2.2.0               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ jake                         │ -              │ 10.8.5              │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ lodash.escape                │ -              │ 4.0.1               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ open                         │ -              │ 8.4.0               │
├──────────────────────────────┼────────────────┼─────────────────────┤
│ setimmediate                 │ -              │ 1.0.5               │
└──────────────────────────────┴────────────────┴─────────────────────┘
spokje’s picture

Right... fun stuff: From the release notes of selenium-webdriver v4.2.0:

[cdp] add support Chrome 102 and remove for Chrome 98

Anybody wanna guess ChromeDriver we're on...
Package Current
chromedriver 98.0.1

spokje’s picture

Indeed the NightWatch tests are going *CLUNK*.

So it looks to me we need to upgrade the Drupal CI Chrome (+chromedriver) to 104 (and we all know the "fun" we had the last time we upped the CI Chrome version) before the update of NightWatch itself can happen.

spokje’s picture

Title: Update Nightwatch to latest version (2.3.3) » [PP-1] Update Nightwatch to latest version (2.3.3)

Created #3306450: Update Chrome container to use newer version upon which this is now postponed.

spokje’s picture

Assigned: spokje » Unassigned
Status: Active » Postponed
lauriii’s picture

Drupal 10 should be on Nightwatch 2.1.4: https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/yarn.lock#L... so I'm not sure where did the Nightwatch 1.7.13 on 10.x come from. Either way we should update to the latest version.

lauriii’s picture

spokje’s picture

so I'm not sure where did the Nightwatch 1.7.13 on 10.x come from.

Me neither, since I said in the IS:

Note: 9.5.x is on Nightwatch 1.7.13, which is the latest release on the 1.x branch. No changes needed there.

nod_’s picture

Issue summary: View changes

v2.3.4 was released last week

andypost’s picture

Title: [PP-1] Update Nightwatch to latest version (2.3.3) » Update Nightwatch to latest version (2.3.3)
Status: Postponed » Active
andypost’s picture

Title: Update Nightwatch to latest version (2.3.3) » Update Nightwatch to latest version (2.3.9)
Status: Active » Needs review
StatusFileSize
new24.36 KB

Here's re-roll just using yarn upgrade nightwatch@^2.3.9

longwave’s picture

StatusFileSize
new29.74 KB

Let's try upgrading the JS chromedriver at the same time, now that the DrupalCI chrome container is also updated.

fcertal’s picture

StatusFileSize
new18.46 KB

Hi folks,

I'm not sure if this is the right place to post my doubt.

On a client's project we're addressing the CVE-2022-36067 vulnerability report, that says:

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. In versions prior to version 3.9.11, a threat actor can bypass the sandbox protections to gain remote code execution rights on the host running the sandbox. This vulnerability was patched in the release of version 3.9.11 of vm2. There are no known workarounds.

Found that vm2 is a dependency of nightwatch and that is in 3.9.9 version in drupal 9.5.x

This isn't installed on the client's server, but they get the warning. So, I've put together the following commands to generate a patch that came out with the vm2 3.9.11.

git clone https://git.drupalcode.org/project/drupal.git
cd drupal
git checkout 9.5.x
yarn upgrade nightwatch
yarn vendor-update
git diff > update-nightwatch.patch

How can I test this patch and figure out if it isn't blow out the entire project?

bnjmnm’s picture

StatusFileSize
new25.18 KB
bnjmnm’s picture

StatusFileSize
new24.81 KB

Removed some commented code from #17

nod_’s picture

Status: Needs review » Reviewed & tested by the community

latest release is 2.4.1 now :p https://github.com/nightwatchjs/nightwatch/releases/tag/v2.4.1

looks good enough to make this update in any case. We can always do the other update later

andypost’s picture

The only nitpick

+++ b/core/yarn.lock
@@ -1430,16 +1448,17 @@ chrome-trace-event@^1.0.2:
-chromedriver@^98.0.1:
-  version "98.0.1"
...
+chromedriver@^106:
+  version "106.0.1"

IIRC Drupal-CI went to 107 already

longwave’s picture

@andypost the version of Chromedriver in yarn.lock doesn't really matter, it is only used when running Nightwatch locally *and* an environment variable is set to use it; I suggested removing it in #3317879: Remove Chromedriver as a JavaScript dependency

longwave’s picture

Title: Update Nightwatch to latest version (2.3.9) » Update Nightwatch to 2.4.1
Issue summary: View changes

Updated IS to reflect correct version number.

finnsky’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new17.15 KB
new37.66 KB

After patch #18 i got deprecation messages from nightwatch
New patch resolve some of them

wim leers’s picture

Status: Needs review » Needs work

#23 is unfortunately no longer passing tests. It also seems like a pretty drastic change compared to #18 which was RTBC'd? 🤔

longwave’s picture

Personally I would prefer to commit #18 which passed tests, and then solve any deprecations separately.

wim leers’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +Needs followup

#25++

Let's do that.

⚠️#18 is RTBC, not #23. Let's create a follow-up to address deprecations.

  • catch committed be0fc49 on 10.0.x
    Issue #3306446 by Spokje, bnjmnm, finnsky, longwave, andypost, fcertal,...
  • catch committed e7668b6 on 10.1.x
    Issue #3306446 by Spokje, bnjmnm, finnsky, longwave, andypost, fcertal,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

Let's open a new issue to address #23.

andypost’s picture

Issue tags: -Needs followup

Filed follow-up #3318301: Fix deprecations of Nightwatch

btw it could be a cause of random failures of JS tests as the message is thrown few times per nightwatch tests, maybe it needs to fix something at infra side

jonathan1055’s picture

We are seeing D10 contrib test runs end with gray "build successful" instead of green "pass" which we get at D9. The modules do not have any nighwatch.js tests and the only difference in the log is that on D9 runs this was marked as a warning, but in D10 it gives an error. Here's a visual comparison of the log:

no nighwatch tests
The above was from Display Suite https://www.drupal.org/node/607826/qa

If this has been caused by the upgrade to nightwatch 2.4.1 then maybe we need to document this somewhere. Also help other contrib maintainers who do not have any nightwatch tests to explain how to skip the nightwatch section. I have done this by removing 'nightwatch.js' in drupalci.yml but many contrib projects are just using the default drupalci.yml (ie they do not have their own to modify)

swentel’s picture

FWIW, I saw this starting to happen yesterday, while working on DS and Field Group, while branch tests where fine 3 days ago, and I wasn't really uploading/committing funky patches :) Adding a drupalci.yml file made it all green again (cf #3318535: Create a drupalci.yml file and #3318536: Create a drupalci.yml file)

@jonathan1055 thanks for the pointers!

jonathan1055’s picture

This is also being discussed on Slack in the #drupal-infrastructure channel
https://app.slack.com/client/T06GX3JTS/C51GNJG91/thread/C51GNJG91-166730...

longwave’s picture

Issue tags: +10.0.0 release notes
hestenet’s picture

Contrib tests should no longer error out with 'Build successful' on DrupalCI. See #3318586: Fix DrupalCI handling of Nightwatch exit codes after 2.4.1 update

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.