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 Integration tests to Auditbeat CI pipeline #37892

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

mjwolf
Copy link
Contributor

@mjwolf mjwolf commented Feb 6, 2024

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

  • 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 6, 2024
@mergify mergify bot assigned mjwolf Feb 6, 2024
Copy link
Contributor

mergify bot commented Feb 6, 2024

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

@mjwolf mjwolf added the Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution label Feb 6, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2024
@mjwolf mjwolf added needs_team Indicates that the issue/PR needs a Team:* label backport-skip Skip notification from the automated backport with mergify labels Feb 6, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2024
@mjwolf mjwolf force-pushed the auditbeat-integTest-ci branch from db2bb07 to 622fdfe Compare February 6, 2024 19:07
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 6, 2024

💚 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 Results
Failed 0
Passed 3
Skipped 0
Total 3

💚 Flaky test report

Tests succeeded.

🤖 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!)

@mjwolf mjwolf force-pushed the auditbeat-integTest-ci branch 3 times, most recently from d98e7d0 to b42246a Compare February 6, 2024 21:26
@mjwolf mjwolf added backport-v8.12.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Feb 6, 2024
@mjwolf mjwolf force-pushed the auditbeat-integTest-ci branch 2 times, most recently from e1f1adc to 5d64714 Compare February 6, 2024 22:23
@mjwolf mjwolf marked this pull request as ready for review February 6, 2024 22:25
@mjwolf mjwolf requested a review from a team as a code owner February 6, 2024 22:25
@elasticmachine
Copy link
Collaborator

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

@mjwolf mjwolf requested review from oakrizan and mmat11 February 6, 2024 22:27
@mmat11
Copy link
Contributor

mmat11 commented Feb 6, 2024

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

Left a comment to raise awareness on GH status notifications and that by using a matrix, failures will be collapsed under one entry. If you are ok with this I won't object, just wanted to make sure the behavior is clearly understood.

machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths:
- "auditbeat/build/*.xml"
- "auditbeat/build/*.json"
notify:
- github_commit_status:
context: "auditbeat: Linux Integration Tests"
context: "auditbeat: Linux x86_64 Integration Tests"
Copy link
Contributor

@dliappis dliappis Jun 4, 2024

Choose a reason for hiding this comment

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

By using a matrix and having a static context we'll be facing the issue that all failures will be collapsed under the same GH status notification.

For example, right now, with passing tests, the notification looks like:

image

If we click the link it takes us to:

image

which represents both Auditbeat Linux x86_64 Integration Tests -- family/platform-ingest-beats-ubuntu-2004 and Auditbeat Linux x86_64 Integration Tests -- family/platform-ingest-beats-ubuntu-2204

So if there is a failure, clicking on the link will take the user to the top of the matrix section, not the specific failed job. Looking at the official BK docs it might be impossible to add {{matrix.image}} -- or another additional property like {{matrix.name}} -- under notify: ["github_commit_stats": {"context": "the message ... {{matrix.property}}"}] (maybe worth testing to be 100% sure).

In any case, my main comment here is to raise awareness about the behavior and that with failures it won't be able to quickly see in the status section which specific image failed.

AWS_IMAGE_UBUNTU_2004_ARM64: "platform-ingest-beats-ubuntu-2004-aarch64"
AWS_IMAGE_UBUNTU_2204_ARM64: "platform-ingest-beats-ubuntu-2204-aarch64"

IMAGE_MACOS_ARM64: "generic-13-ventura-arm"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: re: renaming IMAGE_MACOS_ARM to IMAGE_MACOS_ARM64, ideally we do this in a future PR where we change this as a convention for all the pipelines. For now, it might be ok to leave the name as is, given that there is no 32bit ARM architecture for macOS?

@v1v v1v added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 11, 2024
Copy link
Contributor

mergify bot commented Sep 11, 2024

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

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 16, 2024
@elasticmachine
Copy link
Collaborator

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

With auditbeat, there can be differences in Linux kernels and system
architectures that can affect behaviour. This adds additional system types to
the integration tests that will test more of these configurations.
@mjwolf mjwolf force-pushed the auditbeat-integTest-ci branch from 023021a to 15d5be4 Compare October 18, 2024 18:28
@mjwolf mjwolf added backport-8.16 Automated backport with mergify and removed macOS Enable builds in the CI for darwin testing backport-v8.12.0 Automated backport with mergify labels Oct 18, 2024
@mjwolf
Copy link
Contributor Author

mjwolf commented Oct 18, 2024

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 mjwolf enabled auto-merge (squash) October 21, 2024 20:48
@mjwolf mjwolf requested a review from a team October 21, 2024 21:04
@rowlandgeoff
Copy link
Contributor

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

@oakrizan
Copy link
Contributor

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.

Copy link
Contributor

@oakrizan oakrizan left a comment

Choose a reason for hiding this comment

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

lgtm

@mjwolf mjwolf merged commit efbc4ff into elastic:main Oct 25, 2024
24 checks passed
mergify bot pushed a commit that referenced this pull request Oct 25, 2024
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.

(cherry picked from commit efbc4ff)
mergify bot pushed a commit that referenced this pull request Oct 25, 2024
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.

(cherry picked from commit efbc4ff)
jlind23 pushed a commit that referenced this pull request Jan 6, 2025
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.

(cherry picked from commit efbc4ff)

Co-authored-by: Michael Wolf <[email protected]>
Co-authored-by: Andrew Kroh <[email protected]>
jlind23 pushed a commit that referenced this pull request Jan 6, 2025
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.

(cherry picked from commit efbc4ff)

Co-authored-by: Michael Wolf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Enable builds in the CI for ARM testing backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify enhancement :integrations Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution :Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.