Using mocha for running some tests #2837
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
npm install && npm test
passesDescription of change
Constant GitHub Action failures started after landing 02480f6. One way to fix this is reverting that commit as proposed in #2849. This PR uses a different approach by keeping the
make-fetch-happen
version and making changes in testing modules.The first thing updated is the
tap
module, from its legacy version 12.7.0 to the latest version 16.3.4. This change fixed the failing tests, but afterward,test-addon.js
started failing randomly in GitHub Actions. Rerunning failed jobs would sometimes fix that, but in some cases, mostly on Windows, they stood broken after many reruns. There was no consistency in this and no pattern was to be found. On the other hand, running thenpm test
locally always passed for me and I tested with various node/python combinations.Since I couldn't reproduce any issues locally, I decided to try changing the testing framework (at least for the failing tests). That brings me to my second change - using
mocha
to runtest-addon.js
which had to be adapted to the new framework. After doing this everything passed in the GitHub Actions without any issues.Other ideas
At this time, the solution isn't pretty but it unblocks the CI, which was my main goal. Potentially, all tests can be migrated to
mocha
eventually, thustap
can be removed completely then. Another idea (proposed in #2851) is to simply usemocha
to run tests we already have (eg.mocha test/test-*
) instead oftap
, and keep tests written intap
.