Skip by default compareResults in pipeline tests for serverless#1521
Merged
mrodm merged 4 commits intoelastic:mainfrom Oct 24, 2023
Merged
Conversation
Merged
7 tasks
mrodm
commented
Oct 23, 2023
Comment on lines
-27
to
-48
| var geoIPKeys = []string{ | ||
| "as", | ||
| "geo", | ||
| "client.as", | ||
| "client.geo", | ||
| "destination.as", | ||
| "destination.geo", | ||
| "host.geo", // not defined host.as in ECS | ||
| "observer.geo", // not defined observer.as in ECS | ||
| "server.as", | ||
| "server.geo", | ||
| "source.as", | ||
| "source.geo", | ||
| "threat.enrichments.indicateor.as", | ||
| "threat.enrichments.indicateor.geo", | ||
| "threat.indicateor.as", | ||
| "threat.indicateor.geo", | ||
| // packages using geo fields in nested objects | ||
| "netskope.alerts.user.geo", | ||
| "netskope.events.user.geo", | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Removed since in this PR it is removed the comparison of documents with the samples.
jsoriano
approved these changes
Oct 23, 2023
| ) | ||
|
|
||
| var ( | ||
| serverlessEnableCompareResults = environment.WithElasticPackagePrefix("SERVERLESS_PIPELINE_TEST_ENABLE_COMPARE_RESULTS") |
Member
There was a problem hiding this comment.
Add somewhere a TODO comment mentioning that this is a temporary workaround till we have something better for deterministic geoip in serverless.
jsoriano
reviewed
Oct 23, 2023
| ) | ||
|
|
||
| var ( | ||
| serverlessEnableCompareResults = environment.WithElasticPackagePrefix("SERVERLESS_PIPELINE_TEST_ENABLE_COMPARE_RESULTS") |
Member
There was a problem hiding this comment.
I am thinking now that maybe we should leave this enabled by default, so when running locally, by default we see the errors. And we can disable in the CI jobs where we want to use this. WDYT?
Suggested change
| serverlessEnableCompareResults = environment.WithElasticPackagePrefix("SERVERLESS_PIPELINE_TEST_ENABLE_COMPARE_RESULTS") | |
| serverlessEnableCompareResults = environment.WithElasticPackagePrefix("SERVERLESS_PIPELINE_TEST_DISABLE_COMPARE_RESULTS") |
Contributor
Author
There was a problem hiding this comment.
Ok, agreed
That would make the default behavior to run those comparison and the exception disable them. It makes sense for me. I'll change it.
jsoriano
approved these changes
Oct 24, 2023
Collaborator
💚 Build Succeeded
History
cc @mrodm |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR skips the compare results function for serverless by default. This function is in charge of comparing the documents received by elasticsearch with the samples. The issue is in Serverless, since there are fields related to Geo IP database that cannot be checked properly.
It also adds a new environment variable ELASTIC_PACKAGE_SERVERLESS_PIPELINE_TEST_ENABLE_COMPARE_RESULTS. This new environment variable can be defined to force to run this
compareResultsfunction.When
elastic-package test pipelineis executed with a local stack, there are no changes. The complete pipeline tests are run.Examples to execute with this new environment variable: