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

Running integration tests twice, first with remote_cache and then embedded_cache, fails #3624

Open
StFS opened this issue Apr 9, 2024 · 1 comment

Comments

@StFS
Copy link
Contributor

StFS commented Apr 9, 2024

After building Hono and containers, I go to the tests/ directory and run the integration tests there. If I first run the remote_cache (default) profile, the tests pass fine. But if I then run the embedded_cache profile (without running mvn clean in between), the command-router is unable to start as it tries to connect to the infinispan remote cache with invalid configuration.

Here are the commands that I used with a summary of the results:

cd eclipse-hono
# assume we are now in a clean master checkout of the hono project
mvn install -Pbuild-docker-image,metrics-prometheus -DskipTests=true
# build succeeds
cd tests
mvn verify -Prun-tests,coap-only
# tests run fine and use the remote_cache (infinispan / hotrod)
mvn verify -Prun-tests,coap-only,embedded_cache
# tests fail with an error that the remote cache is being configured (which it shouldn't)

The workaround for this is to run mvn clean in between runs (which can also be achieved by adding the clean target to the second Maven command in the above block, that is mvn clean verify -Prun-tests,coap-only,embedded_cache)

@sophokles73
Copy link
Contributor

I guess this is because we build only one Command Router image for running the ITs and add the selected cache configuration to the image. When you initially ran the tests with the remote cache, the hono-service-command-router-test image is built and the config from the remote-cache folder is added. When you then run the tests with the embedded cache, Maven thinks that the image is already there and does not need to be rebuilt. You might be able to solve this by including the cache profile name into the image name (

<name>${docker.repository}/hono-service-command-router-test:${project.version}</name>
)

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

2 participants