-
Notifications
You must be signed in to change notification settings - Fork 117
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
Support multiple system tests per data_stream #209
Conversation
/test |
This is a great addition, @adriansr. I was wondering how long before we needed it 🙂 . I was on PTO all last week so I'm only seeing this PR now. I should be able to review it today or tomorrow at the latest. |
// Determine test name | ||
name := config.Name | ||
if name == "" { | ||
name = config.Input |
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 understand that the use case for this change is to test with different inputs but I think your solution is more generic than that. So I would not fallback to config.Input
if config.Name
is not defined. I think we can require developers to specify config.Name
always, so if it's empty I think we should error out.
} | ||
c = append(c, single) | ||
} | ||
return c, nil |
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 is nice but I'm wondering if we should simplify and require that the test config should always be a list of cases. That way it's also a hint to package developers that multiple test cases are allowed. Of course, this would mean updating existing system test configurations.
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 this PR has been started too early. It's nice to have a PoC showing the concept, but ideally we kick off with a proposal in package-spec, as it should be adjusted first.
What do you think about keeping the same order as in pipeline tests, which support multiple test cases per data_stream? See: https://github.com/elastic/integrations/tree/master/packages/apache/data_stream/access/_dev/test/pipeline
I'm referring to the name pattern: test-name.config.yml
.
Regarding the config.yml
, I think we have to adjust all integrations, but as there is dependency versioning in place, I don't think we need to rollout changes synchronically.
IMHO the order of steps is the following:
- PR to the package-spec introducing new
config.yml
. - This PR with updated package-spec dependency.
- PR to the Integrations repository polishing all
config.yml
s
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.
Just left a couple of minor comments.
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.
left a general comment
The <data_stream>/_dev/tests/system/config.yml can now be a list of tests, so that multiple inputs and / or multiple configurations can be tested.
Some tests configuration needs variables from the docker-compose, so it's necessary to regenerate the test config.yml after starting the project.
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 see it's ready for review, but once you push this, you will also block updating the elastic-package in Integrations without adjusting multiple files. I'm not convinced about the timeline and wouldn't like to block people. Do you plan to adjust all integrations immediately? I'm referring to this line:
|
|
||
type testConfig struct { | ||
Input string `config:"input"` | ||
Service string `config:"service"` |
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.
@mtojek This is more of a note for us for the future: as we add more service deployers we will need to make sure this field continues to work as expected with the new service deployers as well (not just the Docker compose one that we have today).
@@ -0,0 +1,22 @@ | |||
tcp: | |||
host: "{{tcp_host}}:{{tcp_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.
Is the indentation here correct?
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.
Turns out is not an indentation problem. That tcp
key is just meaningless. Seems like a few packages include this mistake and we've just been repeating it in some places.
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.
Okay, thanks. Can you make an issue (or PR, whatever is easier), probably in the integrations repo to clean up the meaningless keys?
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.
Left a couple of minor comments/questions on indentation. Besides those, this PR LGTM.
Would be nice to have a sister PR ready to go in https://github.com/elastic/integrations that updates all existing system test configs per the new naming convention and syntax introduced in this PR. That way you can just update that PR with the elastic-package dependency once this PR here is merged and we can quickly get all integrations updated as well.
Updates the system tests for the packages that use them to conform to the new format introduced in elastic/package-spec#101 and incorporated in elastic-package tool in elastic/elastic-package#209. This also disables 3 tests that are failing: - cef - crowdstrike - nats/route
This reverts part of the changes in #209 as some tests may require more than one container running at the same time.
Updates the system tests for the packages that use them to conform to the new format introduced in elastic/package-spec#101 and incorporated in elastic-package tool in elastic/elastic-package#209. This also disables 3 tests that are failing: - cef - crowdstrike - nats/route
Updates the system tests runner so that multiple
test-*-config.yml
files can be included in<data_stream>/_dev/tests/system
. This allows testing multiple inputs and/or different configuration options per data stream.Example test for two inputs:
test-tcp-input.yml:
test-udp-input.yml:
The
service
tags allows to uses different containers for the tests. In this case, to generate traffic using different protocols.Sample
docker-compose.yml
in<package>/_dev/deploy/docker
:Related #208
Related elastic/package-spec#101