Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh codebase, use Taskcluster CI #2

Merged
merged 20 commits into from
Feb 7, 2022

Conversation

jwhitlock
Copy link
Contributor

@jwhitlock jwhitlock commented Feb 2, 2022

This attempts to parallel the changes in taskcluster/docker-exec-websocket-server#35. The tests use docker-exec-websocket-server, and pass when run against v3.0.0.

  • When shutting down the server, use socket.terminate() on the WebSocket, which will call socket.destroy() on the underlying Node socket.
  • Fix the test setup / teardown, so that tests exit without mocha --exit (thanks to Stack Overflow commenter Martin P for suggesting why-is-node-running)
  • Update new Buffer(<array or size>) (deprecation warning) to Buffer.from(array) and Buffer.alloc(size).
  • Drop node v8, require v12. Tests continue to pass in node v10, so keeping it in the test matrix for now.
  • Set debug prefixes from docker-exec-websocket-server to docker-exec-websocket-client
  • Update to the latest versions of all dependencies. This includes:
    • Update es-lint to 8.8, upgrade .eslintrc, and fix issues
    • Update mocha to 9.2.0, migrate settings from mocha.opts to package.json
    • Update docker-exec-websocket-server to 3.0.0, which fixes the tests
  • Use community-tc for continuous integration testing. It tests node v10, v12, v14, and v16, as well as the "current" version. It requires a generic worker that is setup to run Docker. It uses docker-compose, which it downloads and installs.
  • Remove tests/runtests.sh, since the test setup creates its own ubuntu container for testing.
  • Remove TravisCI and Vagrant

new Buffer(array or size) was deprecated in v6, emits a warning in
v10 or later.
Upgrade with `yarn upgrade` to upgrade all dependencies that don't
include major versions breaking the specifications in package.json.
* Change eslint rules from deprecated to supported commands.
* Use "ignore", "warn", "error" instead of 0, 1, 2.
* Update to Node.js v10 syntax, and set v10 as minimal version.
* Run "eslint --fix src test"
@jwhitlock jwhitlock marked this pull request as draft February 3, 2022 19:51
The mocha.opts file is no longer used. They are now in the package.json
file, and other locations are possible.
Use "yarn install --ignore-engines", which is also need to test
odd-numbered releases like v15.
The test suite setup includes running an ubuntu container with "sleep
600". This means that the one created by test/runtests.sh is unused and
unneccesary. I removed the script and now call mocha directly, which
allows passing environment variables and extra commands when running
tests. I left docker-compose.yml, but there is the option of using
the (more complex) raw docker commands.

The test suite was not automatically closing because the HTTP servers
were still listening. I added these to the "after" section, and now the
tests exit themselves, and --exit is no longer required.
The `wc -c` call should return 3 characters.
Test no longer execute on node v8. Tests pass on node v10, although
package.json specifies v12 as the minimum supported version.
@jwhitlock jwhitlock changed the title Switch to Taskcluster CI, use current Buffer allocation methods Refresh codebase, use Taskcluster CI Feb 4, 2022
@jwhitlock
Copy link
Contributor Author

I've tested locally that this passes against taskcluster/docker-exec-websocket-server#35. Once that is merged and a new package released, I can update and get tests passing here as well.

@jwhitlock
Copy link
Contributor Author

Tests are passing with the just-released [email protected]. Now to get CI to show the output of tests again...

When running with an auto-allocated TTY, the test output is often
omitted from the live log.
@jwhitlock jwhitlock marked this pull request as ready for review February 7, 2022 20:47
@jwhitlock jwhitlock requested a review from matt-boris February 7, 2022 21:35
@jwhitlock jwhitlock requested a review from petemoore February 7, 2022 21:35
@jwhitlock jwhitlock merged commit 046ebd3 into taskcluster:master Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants