Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Add autodiscover 2e2 testcases for Agent (standalone)#1645

Merged
mdelapenya merged 13 commits intoelastic:masterfrom
ChrsMark:add_agent_autodiscovery_cases
Oct 15, 2021
Merged

Add autodiscover 2e2 testcases for Agent (standalone)#1645
mdelapenya merged 13 commits intoelastic:masterfrom
ChrsMark:add_agent_autodiscovery_cases

Conversation

@ChrsMark
Copy link
Copy Markdown
Member

@ChrsMark ChrsMark commented Oct 7, 2021

What does this PR do?

This PR adds autodiscover test cases for elastic-agent standalone.

Why is it important?

To cover autodiscover in Agent with 2e2 tests.

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 run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark added the Team:Integrations Label for the Integrations team label Oct 7, 2021
@ChrsMark ChrsMark self-assigned this Oct 7, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 7, 2021

This pull request is now in conflict. Could you fix it @ChrsMark? 🙏
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 add_agent_autodiscovery_cases upstream/add_agent_autodiscovery_cases
git merge upstream/master
git push upstream add_agent_autodiscovery_cases

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Oct 7, 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-15T09:30:43.036+0000

  • Duration: 34 min 14 sec

  • Commit: e334b2d

Test stats 🧪

Test Results
Failed 0
Passed 238
Skipped 0
Total 238

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

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

  • /test : Re-trigger the build.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@@ -0,0 +1,9 @@
@kubernetes-autodiscover
@elastic-agent
Feature: elastic-agent standalone
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's awesome you had to write NO Go code to implement a scenario!

image

@mdelapenya
Copy link
Copy Markdown
Contributor

@ChrsMark thanks for your first contribution to the project! It is indeed great!

I'm only missing one change to add the new scenarios. As explained in the docs (https://github.com/elastic/e2e-testing/tree/master/e2e#feature-files-and-the-ci) the CI will use the .ci/.e2e-tests.yaml file to spread the feature files on the parallel CI workers. Simply using this block will do the trick:

  - suite: "kubernetes-autodiscover"
    platforms:
      - labels: "ubuntu-18.04"
    scenarios:
      - name: "kubernetes autodiscover with elastic-agent"
        tags: "kubernetes-autodiscover && elastic-agent"
      - name: "kubernetes autodiscover with filebeat"
        tags: "kubernetes-autodiscover && filebeat"
      - name: "kubernetes autodiscover with heartbeat"
        tags: "kubernetes-autodiscover && heartbeat"
      - name: "kubernetes autodiscover with metricbeat"
        tags: "kubernetes-autodiscover && metricbeat"

Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

Only missing what described in #1645 (comment).

Once there, I'd merge this one :)

@mdelapenya
Copy link
Copy Markdown
Contributor

One last question: could you please add labels for backports?

  • v7.16.0 label -> 7.x branch
  • v7.15.0 label -> 7.15.x branch
  • v7.14.0 label -> 7.14.x branch

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark requested a review from mdelapenya October 11, 2021 12:29
@ChrsMark
Copy link
Copy Markdown
Member Author

I wonder what makes it failing on the CI while it works locally 🤔

@mdelapenya
Copy link
Copy Markdown
Contributor

I wonder what makes it failing on the CI while it works locally 🤔

I'm manually running the CI using TRACE log level: https://beats-ci.elastic.co/job/e2e-tests/job/e2e-testing-mbp/job/PR-1645/7/. Let's check if that error is repeatable

@mdelapenya
Copy link
Copy Markdown
Contributor

@ChrsMark it passed, although the single failure that is currently present (windows related) is considered flaky.

https://beats-ci.elastic.co/blue/organizations/jenkins/e2e-tests%2Fe2e-testing-mbp/detail/PR-1645/7/pipeline/226

I'd say this is LGTM

ChrsMark and others added 2 commits October 11, 2021 23:47
…ture

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
…-agent.yml.tmpl

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
@ChrsMark
Copy link
Copy Markdown
Member Author

ChrsMark commented Oct 12, 2021

Thanks for reviewing @mdelapenya ! After applying your suggestions the k8s suite failed again and I'm not sure I can understand the reason. I'm particularly concerned of introducing some flakiness here so could you spot where it fails when this happen?

@ChrsMark ChrsMark requested a review from mdelapenya October 14, 2021 07:10
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM 👍

image

@mdelapenya
Copy link
Copy Markdown
Contributor

@ChrsMark this is ready to go, merging!

@mdelapenya mdelapenya merged commit a23b3b4 into elastic:master Oct 15, 2021
mergify bot pushed a commit that referenced this pull request Oct 15, 2021
* Add initial case

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Add go dep

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Add go dep

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Review changes and more tests

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Add more cases

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Add extra case

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* Update e2e/_suites/kubernetes-autodiscover/features/elastic-agent.feature

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* Update e2e/_suites/kubernetes-autodiscover/testdata/templates/elastic-agent.yml.tmpl

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* Fix scope of cronjob test

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

* chore: fix go fmt

* chore: do not destroy kind cluster in DEV mode

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
(cherry picked from commit a23b3b4)
@jsoriano
Copy link
Copy Markdown
Member

❤️ thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Team:Integrations Label for the Integrations team v7.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Kubernetes autodiscover test cases for standalone Agent

4 participants