beats icon indicating copy to clipboard operation
beats copied to clipboard

Add Integration tests to Auditbeat CI pipeline

Open mjwolf opened this issue 1 year ago • 15 comments

Proposed commit message

Refactor the CI integration test steps for the Auditbeat pipeline to use build matrices for Linux tests. By doing this, it will be easier to add additional VM types to the integration tests in the future.

With this, the integration tests will run on Ubuntu 20.04, 22.04, 24.04 for both x86_64 and arm64, and RHEL 9 x86_64.

Checklist

  • [x] 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~~
  • [x] 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.~~

mjwolf avatar Feb 06 '24 19:02 mjwolf

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @mjwolf? 🙏. For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

mergify[bot] avatar Feb 06 '24 19:02 mergify[bot]

:green_heart: 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: 2024-02-07T22:21:13.971+0000

  • Duration: 12 min 27 sec

Test stats :test_tube:

Test Results
Failed 0
Passed 3
Skipped 0
Total 3

:green_heart: Flaky test report

Tests succeeded.

:robot: GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

elasticmachine avatar Feb 06 '24 19:02 elasticmachine

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

elasticmachine avatar Feb 06 '24 22:02 elasticmachine

I guess these can be removed then https://github.com/elastic/beats/blob/main/auditbeat/Jenkinsfile.yml#L33-L50

mmat11 avatar Feb 06 '24 22:02 mmat11

I guess these can be removed then https://github.com/elastic/beats/blob/main/auditbeat/Jenkinsfile.yml#L33-L50

Please keep the Jenkinsfiles in its' original state, since we still will need them

oakrizan avatar Feb 07 '24 11:02 oakrizan

All the improvements/new features have to be postponed until the migration is completed. Migration has a hard deadline and is ongoing. cc: @dliappis @jlind23

I'll wait until the migration is completed before I merge this

mjwolf avatar Feb 07 '24 22:02 mjwolf

:broken_heart: Build Failed

Failed CI Steps

History

  • :broken_heart: Build #2636 failed 6e0544b558defe4977d57fd541d503921a404213
  • :broken_heart: Build #2620 failed d98e7d09bc12c9db7d5002ace8fc042af7d83ba2

cc @mjwolf

elasticmachine avatar Feb 07 '24 23:02 elasticmachine

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b auditbeat-integTest-ci upstream/auditbeat-integTest-ci
git merge upstream/main
git push upstream auditbeat-integTest-ci

mergify[bot] avatar Apr 15 '24 09:04 mergify[bot]

I'll wait until the migration is completed before I merge this

I think buildkite the migration is mostly finished now. Is that correct, @dliappis?

So work on this could resume.

andrewkroh avatar May 30 '24 14:05 andrewkroh

I think buildkite the migration is mostly finished now. Is that correct, @dliappis?

Correct.

dliappis avatar May 30 '24 14:05 dliappis

either the VM image doesn't exist (Debian 10) or the image needs to be updated with additional tools to be able to run the tests (RHEL 8, SUSE 12). The images will need to be created/updated before they can be added to the integration tests.

Creating/updating these images will require planning and work on the Ingest Eng Prod team, and isn't something we can address during this PR. If you'd like to move forward with increasing your test coverage, I'd recommend pulling out the RHEL 8 and SLES 12 references until we can get to those. Assessing all of the beats and their test coverage relative to the compat matrix is something we were recently talking about, but it's going to take some time to assess and scope the work.

rowlandgeoff avatar May 30 '24 21:05 rowlandgeoff

either the VM image doesn't exist (Debian 10) or the image needs to be updated with additional tools to be able to run the tests (RHEL 8, SUSE 12). The images will need to be created/updated before they can be added to the integration tests.

Creating/updating these images will require planning and work on the Ingest Eng Prod team, and isn't something we can address during this PR. If you'd like to move forward with increasing your test coverage, I'd recommend pulling out the RHEL 8 and SLES 12 references until we can get to those. Assessing all of the beats and their test coverage relative to the compat matrix is something we were recently talking about, but it's going to take some time to assess and scope the work.

Hi, @rowlandgeoff, thanks, I see now that a lot of the images in the platform-ingest-beats family don't exist. I was planning to add them myself (at least the easy ones that can be based off the existing core images), but if your team is planning to do it, I can wait for it.

For this PR, I've removed the images that don't exist and updated the description with what I've done now

mjwolf avatar May 30 '24 21:05 mjwolf

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b auditbeat-integTest-ci upstream/auditbeat-integTest-ci
git merge upstream/main
git push upstream auditbeat-integTest-ci

mergify[bot] avatar Sep 11 '24 13:09 mergify[bot]

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar Sep 16 '24 13:09 elasticmachine

I'd like to revive this PR. I've added all the Linux 'platform-ingest-beats' VM images that currently exist and removed the variable name changes that weren't necessary.

@leehinman, @dliappis, @pkoutsovasilis could you review this again, since it's changed since you last looked at it?

mjwolf avatar Oct 18 '24 19:10 mjwolf

LGTM. @oakrizan can you please review? Any overlap with your current changes?

rowlandgeoff avatar Oct 24 '24 21:10 rowlandgeoff

We deliberately were avoiding matrix usage. In addition to what Dimitrios said about matrix - if one of the matrix-based steps fails, then particular GH check will hang in "Pending" state.

oakrizan avatar Oct 25 '24 07:10 oakrizan