Skip to content
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

Port Python tests of log input to Golang with filestream input #24246

Closed
48 of 61 tasks
kvch opened this issue Feb 25, 2021 · 4 comments
Closed
48 of 61 tasks

Port Python tests of log input to Golang with filestream input #24246

kvch opened this issue Feb 25, 2021 · 4 comments

Comments

@kvch
Copy link
Contributor

kvch commented Feb 25, 2021

Why?

The goal of this issue is to move all Python tests related to the log input to Golang and use the new filestream input. These existing tests cover valuable knowledge about edge cases of the log input. To make sure filestream input is at least as stable as the log input, we need to run the same tests for the new input.

How?

All end-to-end tests are written in Python for the log input. However, some of these test does not require starting Filebeat, asserting that specific log lines are present, etc. It is much faster to run the input itself from Golang and assert that events have arrived and offsets are updated in the registry. Furthermore, these test no longer depend on log messages so changing logging will not break existing tests.

Note: It might turn out that some of the test below are better suited for Python E2E tests. In this case, we are going to run the same test for both input types with the help of parameterized.

What?

@kvch kvch added meta :Testing Team:Elastic-Agent Label for the Agent team labels Feb 25, 2021
@kvch kvch self-assigned this Feb 25, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@kvch
Copy link
Contributor Author

kvch commented Apr 4, 2022

The tests that are already running in Golang using the filestream input can be deleted from the Python test suite. We no longer support the log input, so there is no need to run duplicate tests for it.

@kvch
Copy link
Contributor Author

kvch commented Jun 21, 2022

Significant tests that are missing from filestream:

The tests from test_registry.py should not be migrated because most of the are low-value and specific to the log input. Some of the tests like test_clean_inactive or test_clean_removed is tested from the package input-logfile. But as the registry behaves differently in filestream, it does not really make sense to compare the two tests.

Remaining tests from test_json.py are also valuable as an INTEGRATION test, not as E2E tests. JSON tests cover the common code paths used by both log and filestream inputs.

@botelastic
Copy link

botelastic bot commented Jun 24, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Jun 24, 2023
@botelastic botelastic bot closed this as completed Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants