-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add integration test against Janus #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
|
||
private static TaskId randomTaskId() { | ||
byte[] bytes = new byte[32]; | ||
new Random().nextBytes(bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly nit, can leave it if you don't think it's pertinent: java.util.Random
is not a CSPRNG.
For practical usage in these tests it probably doesn't matter, but I would be worried about someone reading these tests for reference on how to use the library, and copying over usage of java.util.Random
.
); | ||
/** @noinspection SpellCheckingInspection */ | ||
private static final DockerImageName JANUS_INTEROP_COLLECTOR = DockerImageName.parse( | ||
"us-west2-docker.pkg.dev/divviup-artifacts-public/janus/janus_interop_collector@sha256:982110bc29842639355830339b95fac77432cbbcc28df0cd07daf91551570602" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: why are these SHAs rather than tagged versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it for consistency with divviup-ts, but I now see that we have both the tag and SHA over there. I'll update this to match.
The Java version of testcontainers has some interesting features that might be worth copying in Janus. First off, they start up a daemon called Ryuk in a container that does last-resort container cleanup if the test process disconnects and doesn't clean up after itself for whatever reason. Second, they have a feature that allows exposing a TCP server on a host port within a container network. Under the hood, this works by running sshd in a container, attached to the correct Docker network, and running ssh on the host with reverse tunnel options set. This could allow for new combinations of in-process an containerized aggregators in our integration tests. |
This adds an integration test against Janus, making use of the Java testcontainers library to manage the lifetime of our Janus interoperation test containers. This closes #13.