-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix fixed host port test #1355
Fix fixed host port test #1355
Conversation
merge base
…ainer, followed path of original test;
crap, you are not using assertj in testCompile. People are crying :) |
…in response getting now fails test directly with io exc
core/src/test/java/org/testcontainers/junit/FixedHostPortContainerTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/testcontainers/junit/FixedHostPortContainerTest.java
Outdated
Show resolved
Hide resolved
…to alpine, also copied some routines from generic container tests
core/src/test/java/org/testcontainers/junit/FixedHostPortContainerTest.java
Show resolved
Hide resolved
core/src/test/java/org/testcontainers/junit/FixedHostPortContainerTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/testcontainers/junit/FixedHostPortContainerTest.java
Outdated
Show resolved
Hide resolved
// assertEquals("The bucket content was successfully set", "foo", redisson.getBucket("test").get()); | ||
// assertEquals("The container returns the fixed port from getMappedPort(...)", freePort, redis.getMappedPort(REDIS_PORT)); | ||
final Integer unusedHostPort; | ||
String content; |
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.
this can be try-scoped
…code style updates based on PR
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
Hmm, I don't think we should have let this get stale - reopening. Sorry @glebsts! |
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.
Looks good! Thank you @glebsts! Sorry for such a long review time 😊
Will merge once CI is green
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.
Thanks also from me, @glebsts. Build is green so I'll merge.
Child of this slack thread
Before:
FixedHostPortContainerTest
basically just started redis two times without any assertions. Test used redis container and had some cryptic commented-out assertion flow, so nothing was actually tested except for "container starts", in theory throwing undeterminedIOException
in case of any failure.Now: test starts container with simple open-source http echo server image [1] [2], validates that port ia accessible, stops, takes "free to use host port" and starts container again with fixed host port, validates that port is accessible.
Added as much javadoc and assertion descriptions as I could. Hopefully codestyle is ok, or I will fix it based on any report provided.
Any comments are much appreciated.
As far as I can see, since my last PR changelog is not used anymore, so guess I don't need to add any notes.