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

chore: decouple unit and integration tests on CI #27069

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

mdelapenya
Copy link
Contributor

What does this PR do?

We are keeping Pipeline2.0-consistency across Beats calling the Python system-tests, using OSS metricbeat's as the canonical reference: run unit tests, then Go integration tests, and finally Python integration tests when needed. This change applies to filebeat and metricbeat in both OSS and xpack flavours.

I finally revisited each Beat and made sure all of them run the unit, goInteg and pythonInteg tests in a consistent manner: instead of calling the obscure mage test command, we separate it in three different stages when needed: mage unitTest, mage goIntegTest and mage pythonIntegTest. I've verified one by one that each of those three commands is present in the build for the related Beat, adding or removing them from the CI descriptor (Jenkinsfile.yml) when/if needed, creating the consistent experience of running atomic commands for each test type.

Why is it important?

First is consistency: metricbeat and filebeat are running system-tests, and we want to operate all Beats on CI in the same manner. That's why we are making the descriptors very similar.

And second, separation of concers: we want to run unit > integration > e2e tests in different stages, so that we acknowledge the power of not building/running code that could have been broken after a possible failure in a previous stage.

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.

Author's Checklist

  • [ ]

Related issues

@mdelapenya mdelapenya self-assigned this Jul 27, 2021
@mdelapenya mdelapenya added the Team:Automation Label for the Observability productivity team label Jul 27, 2021
@mdelapenya mdelapenya requested a review from a team July 27, 2021 10:51
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 27, 2021
@elasticmachine
Copy link
Collaborator

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-07-27T10:51:18.218+0000

  • Duration: 153 min 37 sec

  • Commit: 88e9027

Test stats 🧪

Test Results
Failed 0
Passed 49331
Skipped 5320
Total 54651

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 49331
Skipped 5320
Total 54651

@mdelapenya mdelapenya marked this pull request as ready for review July 27, 2021 13:46
@mdelapenya mdelapenya requested review from a team as code owners July 27, 2021 13:46
@mdelapenya mdelapenya requested a review from jsoriano July 27, 2021 14:12
@jsoriano jsoriano requested a review from andrewkroh July 29, 2021 16:46
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I grepped the code to see if any projects were implementing there own mage test that does something other than unitTest + integTest and I didn't find anything.

@mdelapenya mdelapenya added backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify labels Jul 30, 2021
@mdelapenya mdelapenya merged commit 777daee into elastic:master Jul 30, 2021
mergify bot pushed a commit that referenced this pull request Jul 30, 2021
mergify bot pushed a commit that referenced this pull request Jul 30, 2021
mergify bot pushed a commit that referenced this pull request Jul 30, 2021
mdelapenya added a commit that referenced this pull request Jul 30, 2021
(cherry picked from commit 777daee)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Jul 30, 2021
(cherry picked from commit 777daee)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Aug 2, 2021
(cherry picked from commit 777daee)

Co-authored-by: Manuel de la Peña <[email protected]>
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants