-
Task
-
Resolution: Done
-
Undefined
-
None
-
None
-
rhel-pt-ruby-nodejs
-
ssg_platform_tools
-
PT PRNDL 2025 S02, PT PRNDL 2025 S03, PT PRNDL 2025 S04
-
3
-
False
-
-
None
Before being able to run the nodejs unit tests properly as a gating test or during a build (tracked separately), we can run at least some tests during the build, to see whether the known-to-succeed tests still succeed.
The following are steps for running a single unit test in a very naive form:
# Start with having the nodejs installed: $> sudo yum install nodejs22 # we need some rpm development deps $> sudo yum install rpm-build # download and install corresponding srpm $> dnf download --srpm nodejs22 $> rpm -i nodejs22*.src.rpm # unpack the SRPM and apply patches, ignore errors here, as not whole %prep section passes $> rpmbuild -bp rpmbuild/SPECS/nodejs22.spec --nodeps || : # navigate to the tests directory $> cd rpmbuild/BUILD/nodejs22-22.11.0-build/node-v22.11.0/ $> cd test/async-hooks/ # run a single unit test in a very naive way: $> node test-async-local-storage-no-mix-contexts.js $> echo $?
Knowing how to run a single test, we can have a list of tests that we expect to succeed (needs to be generated based on the current status) – let's call it tests-should-pass.list.
We can have a script (a shell script might be enough) that takes such a file (or more files) and loops through such a list of unit tests and run each test individually, to check whether it still succeeds. There can be filtering done to not a single test to be run multiple times.
The script should be able to use the nodejs binary that is available as part of the RPM build, as well as the installed /usr/bin/node. Whether this is a configurable optoin (script argument) or guessed, is kept up to engineer's choice.
This script is available in the sources of the nodejs SRPM.
For the gating test, especially for the regressions testing, we can have a different list (shorter) with only tests listed that we care about. That way, if we want to add a regression test, that is available in the nodejs SRPM, we only add this test into the list.