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

Add unit tests for harvester.go of input-logfile package #24107

Merged
merged 9 commits into from
Mar 10, 2021

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Feb 18, 2021

What does this PR do?

This PR adds unit tests for readerGroup and defaultHarvesterGroup of the filestream input.

It also creates a separate error for if a Harvester is already running for a source.

Why is it important?

Test coverage for harvester.go is increased from 0% to 98.4%.

Overall coverage of github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile is increased from 47.4% to 64.8%.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 18, 2021
@kvch kvch requested a review from urso February 18, 2021 13:06
@kvch kvch added the Team:Elastic-Agent Label for the Agent team label Feb 18, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 18, 2021
@kvch kvch added the needs_backport PR is waiting to be backported to other branches. label Feb 18, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #24107 updated

  • Start Time: 2021-03-05T16:00:48.534+0000

  • Duration: 143 min 44 sec

  • Commit: 16db6e9

Test stats 🧪

Test Results
Failed 0
Passed 45880
Skipped 4916
Total 50796

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 45880
Skipped 4916
Total 50796

@kvch kvch force-pushed the test-filebeat-add-filestream-harvestergroup branch from f15a004 to e901056 Compare February 18, 2021 17:51
@kvch
Copy link
Contributor Author

kvch commented Feb 19, 2021

TestDefaultHarvesterGroup/assert_a_harvester_can_be_stopped_and_removed_from_bookkeeper appears flaky locally as well.

@kvch kvch force-pushed the test-filebeat-add-filestream-harvestergroup branch from 0feb11f to 9be1c0f Compare February 19, 2021 14:58
@kvch kvch force-pushed the test-filebeat-add-filestream-harvestergroup branch from b60e3b3 to c98f50c Compare March 2, 2021 15:27
libbeat/tests/resources/goroutines.go Outdated Show resolved Hide resolved
libbeat/tests/resources/goroutines.go Outdated Show resolved Hide resolved
@kvch kvch force-pushed the test-filebeat-add-filestream-harvestergroup branch from 407d1fd to 16db6e9 Compare March 5, 2021 15:59
@kvch kvch merged commit 93fdd0a into elastic:master Mar 10, 2021
v1v added a commit to v1v/beats that referenced this pull request Mar 16, 2021
…reporting-changes

* upstream/master: (23 commits)
  [Auditbeat] btmp offset check (elastic#24515)
  Clarify that the Tomcat module is for ingesting access logs (elastic#24543)
  [Ingest Manager] Move logging defaults to agent (elastic#24535)
  Update input-http-endpoint.asciidoc (elastic#24490)
  Fix typo in mqtt input docs (elastic#24509)
  [Elastic Agent] Add verification check when updating communication to Kibana. (elastic#24489)
  Refactor use of system.hostfs to fix cgroup metrics (elastic#24334)
  Add test for close.reader.after_interval to filestream input (elastic#24423)
  chore(ci): use beat_version instead of PR version (elastic#24446)
  Add syntax for multiple selector logging (elastic#24207) (elastic#24497)
  Update Golang to 1.15.9 (elastic#24442)
  [Elastic Agent] Add the ability to provide custom CA's inside of docker. (elastic#24486)
  Add tests for encoding settings of filestream input (elastic#24426)
  [Ingest Manager] Sync on rename on windows (elastic#24504)
  Port four Harvester tests of log input to filestream in Golang (elastic#24250)
  [DOCS] Restructure content for SSL settings (elastic#24342)
  Move example to the correct location in reference docs (elastic#24455)
  Add unit tests for harvester.go of input-logfile package (elastic#24107)
  Fix type for uwsgi.status.worker.rss field (elastic#24468)
  [Ingest Manager] Logging to file disabled on enroll (elastic#24466)
  ...
kvch added a commit to kvch/beats that referenced this pull request Mar 17, 2021
## What does this PR do?

This PR adds unit tests for `readerGroup` and `defaultHarvesterGroup` of the `filestream` input.

It also creates a separate error for if a Harvester is already running for a source.

## Why is it important?

Test coverage for `harvester.go` is increased from 0% to 98.4%.

Overall coverage of `github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile`  is increased from 47.4% to 64.8%.

(cherry picked from commit 93fdd0a)
@kvch kvch added v7.13.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 17, 2021
kvch added a commit that referenced this pull request Mar 18, 2021
…4605)

## What does this PR do?

This PR adds unit tests for `readerGroup` and `defaultHarvesterGroup` of the `filestream` input.

It also creates a separate error for if a Harvester is already running for a source.

## Why is it important?

Test coverage for `harvester.go` is increased from 0% to 98.4%.

Overall coverage of `github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile`  is increased from 47.4% to 64.8%.

(cherry picked from commit 93fdd0a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants