Skip to content

Commit

Permalink
Update the nvm required by the Dashboard (#2984)
Browse files Browse the repository at this point in the history
PBENCH-891

This PR addresses some of the issues that we've seen recently with the Dashboard unit testing in the CI. This was the result of a breaking change to the tough-cookie component. tough-cookie is not used by the Dashboard; rather, it's a dependency of a dependency of Jest which we use for Dashboard unit testing.

This PR makes three changes:

* Add an explicit (development) dependency on tough-cookie v4.1.2 (the breakage was introduced in v4.1.0, and v4.1.1 was a failed attempt to fix it); without the explicit dependency, we seem to still pick up v4.1.0.

* Add a command to the build script to remove the node_modules directory, to ensure that we pick up a fresh installation of our dependencies. (There are other ways to accomplish this (such as the npm commands, clean-install and ci), but without a version-controlled package-lock.json file, they all present problems, so we'll just brute-force it for now.) Also, since it's not currently version-controlled, remove the package-lock.json file, so that we generate a fresh set of dependencies on each build.

* Remove the dependency on nvm. It pulls a very old version of the manager, and we don't seem to actually need it (at least, as a production dependency...).
  • Loading branch information
webbnh authored Aug 26, 2022
1 parent 0c18972 commit 519d69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ if [[ ${GITTOP} =~ "fatal: unsafe repository ('/home/root/pbench'" ]] ; then
fi

# Install the Dashboard dependencies, including the linter's dependencies and
# the unit test dependencies.
( cd dashboard && npm install )
# the unit test dependencies. First, remove any existing Node modules and
# package-lock.json to ensure that we install the latest.
( cd dashboard && rm -rf node_modules package-lock.json && npm install )

# Test for code style and lint
black --check .
Expand Down
4 changes: 2 additions & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"jest": "^27.5.1",
"js-cookie": "^3.0.1",
"less-watch-compiler": "^1.16.3",
"nvm": "0.0.4",
"patternfly": "^3.9.0",
"react": "^17.0.2",
"react-app-rewired": "^2.2.1",
Expand Down Expand Up @@ -88,6 +87,7 @@
"jsdoc": "^3.6.10",
"less": "^4.1.2",
"less-loader": "^11.0.0",
"prettier": "^2.6.2"
"prettier": "^2.6.2",
"tough-cookie": "^4.1.2"
}
}

0 comments on commit 519d69f

Please sign in to comment.