-
Notifications
You must be signed in to change notification settings - Fork 25k
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 GeoIP CLI integration test #71381
Conversation
Pinging @elastic/es-core-features (Team:Core/Features) |
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 looks good. I left a few questions.
@@ -59,6 +60,7 @@ | |||
import static org.hamcrest.Matchers.is; | |||
import static org.hamcrest.Matchers.nullValue; | |||
|
|||
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST) |
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 think the test cluster can be reused? So this annotation can be removed?
@@ -72,7 +74,8 @@ | |||
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { | |||
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)); | |||
if (ENDPOINT != null) { | |||
settings.put(GeoIpDownloader.ENDPOINT_SETTING.getKey(), ENDPOINT); | |||
String endpoint = getTestName().endsWith("Cli") ? ENDPOINT + "cli/overview.json" : ENDPOINT; |
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.
maybe set/overwrite the custom endpoint for cli files in the testGeoIpDatabasesDownloadCli()
test instead of here with a conditional? I think it is clearer to have this logic where it is used.
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 refactored CLI case to separate class so it's cleaner now
Path source = Path.of("source"); | ||
Files.createDirectory(source); | ||
|
||
Path target = Path.of("target"); |
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.
Do these paths end up in the build directory of the geoid-fixture module?
Otherwise perhaps we should create tmp dirs instead?
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.
Fixtures are run inside docker container which is then discarded, I think we can get away with using current directory
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.
LGTM
This change adds additional test to GeoIpDownloaderIT which tests that artifacts produces by GeoIP CLI tool can be consumed by cluster the same way as from our original service. It does so by running the tool from fixture which then simply serves the generated files (this is exactly the way users are supposed to use the tool as well). Relates to elastic#68920 # Conflicts: # test/fixtures/geoip-fixture/src/main/java/fixture/geoip/GeoIpHttpFixture.java
* Add GeoIP CLI integration test (#71381) This change adds additional test to GeoIpDownloaderIT which tests that artifacts produces by GeoIP CLI tool can be consumed by cluster the same way as from our original service. It does so by running the tool from fixture which then simply serves the generated files (this is exactly the way users are supposed to use the tool as well). Relates to #68920 # Conflicts: # test/fixtures/geoip-fixture/src/main/java/fixture/geoip/GeoIpHttpFixture.java * fix compilation
This change adds additional test to
GeoIpDownloaderIT
which tests that artifacts produces by GeoIP CLI tool can be consumed by cluster the same way as from our original service.It does so by running the tool from fixture which then simply serves the generated files (this is exactly the way users are supposed to use the tool as well).
Relates to #68920