This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 241
Fix failing tests and run them all in travis #297
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As configured in the pom file, only some unit tests are actually runned by travis. The main effect is that the tests are actually failing for a long time now. Change pom to play all tests.
- Rename checks to understand what they were actually testing, - Fix failing tests, - Remove useless checked Exception (as none is required). Note that the tests must be improved, but it is not the topic here.
Session are created, not never destroyed. It creates issues for over tests, so destroy the sessions once the test is done (successful or not).
Tests were failing, but never run. - sessionClient and keyValueClient has been added in setUp to remove duplication - some tests were renammed as they did not indicate what the test was doing - opened sessions are now destroy at the end of the test - remove unused "throws Exception" in methods signature - split testAcquireLock in 3 tests
- close opened cache - rename test method when not explicit - fix keyStr/valStr (root was not included, so failure) - fix number of events: +1 as one event is generated at cache start - replace addListener(...) by reference method when possible (making it readable)
getDebugConfig() is not available in Consul 0.7.2 (so no testable). However, the assertion is not related to the test. Hence, remove the failing assertion.
getDebugConfig() is not available in Consul 0.7.2 (so no testable). Rewrite the tests to do the same thing without getDebugConfig(). Note that we also close the cache.
adericbourg
suggested changes
Jan 31, 2018
.stream() | ||
.filter(key -> serviceId.equals(key.getServiceId()) && (port == key.getPort())) | ||
.findFirst() | ||
.orElse(null); |
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.
Cannot we use an Option
instead of null
?
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.
Done.
|
||
assertEquals(serviceId, health.getService().getId()); | ||
assertEquals(serviceId2, health2.getService().getId()); | ||
private ServiceHealthKey getServiceHealthKeyFromCache(ServiceHealthCache cache, String serviceId, int port) { |
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.
Seems to me it could be static
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.
Done.
Regarding @a.dericbourg review: - make getServiceHealthKeyFromCache static - make getServiceHealthKeyFromCache return an Optional (no null)
adericbourg
approved these changes
Jan 31, 2018
LGTM |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As explain in issue #296, all some tests are run by maven, so: