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

Translate integration test suite to Javacript #191

Open
4141done opened this issue Dec 15, 2023 · 0 comments
Open

Translate integration test suite to Javacript #191

4141done opened this issue Dec 15, 2023 · 0 comments

Comments

@4141done
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently the integration test suite has the following issues:

  • It is not separate from the image build
  • It is tough to understand at first. Especially for new contributors
  • New configuration options combined with bash's inflexibility are leading to an increasingly difficult to maintain test suite.

Describe the solution you'd like

  1. Decouple image build from integration test run (this will help us clean up the build task and start building multi-arch images)
  2. Use a NodeJS-based test runner to perform integration tests

Describe alternatives you've considered
I could be possible to refactor the bash-based runner to handle things better but:

  • It seems contributors are more familiar with Javascript than NGINX/Bash. This will lower dependence on the maintainer for tests.
  • The new maintainer is more comfortable in JS.
This was referenced Jan 5, 2024
4141done added a commit that referenced this issue Jan 12, 2024
# What
Allows us to push multi-architecture builds for `linux/amd64` and `linux/arm64` on merge to master. Fixes: #196

Tests are performed by building the relevant image and tagging it with the image name the tests expect.  This follows the original implementation in `test.sh`.  This will likely change to an explicit image name specification as we move the test suite in to Javascript but it's being maintained for now in the interest of simplicity.

## Goals
* To decouple image build from the test run. This will help as we refactor the test suite for this issue #191.
* Not have CI take a long time due to multi-architecture builds for interim pushes to pull requests.
* CI should fail fast if any of the image builds or tests fail
* Parallelize builds as much as possible.


## Notes
* Since the `unprivileged` and `latest-njs` images build off the base `oss` image, there were some strange moves that had to be done to make that work without rebuilding the base image every time. Specifically, we had to set `setup-buildx-action` to run in `docker` driver mode so we can simply `load` the base image. Otherwise we would have had to use a local repository.  However, in `docker` mode `upload-artifact` doesn't like the file produced so we have to save the file again.
* I wanted to build images once and then run tests against them and push at the end. However, there was not a clean way to get the full multi-architecture images all the way to the push step so I just build them again against all architectures and perform tests in the runner architecture.  This saves us from needing conditionals in the test portions.
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

No branches or pull requests

1 participant