Skip to content

Conversation

@pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Jun 26, 2025

What does this PR do?

As request in previous PR reviews this PR introduces Single mage targets for the serverless and leak integration test packages, similar to the existing TestKubernetesSingle target. It adds the following functions to the magefile.go:

  • TestServerlessSingle
  • TestForResourceLeaksSingle

Internally, both new targets delegate to shared helper functions that support selecting a specific test by name. This unifies the way we run individual integration tests across packages and prepares the mage targets for further package splits.

Why is it important?

As part of the effort to split the increasingly large integration test suite into smaller dedicated packages (see parent issue), we also need to ensure that developers can run individual tests from each new package using a consistent interface.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • 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/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

None. This PR only introduces new mage targets for developer convenience without affecting existing workflows.

How to test this PR locally

Invoke the new mage targets 🙂

Related issues

@pkoutsovasilis pkoutsovasilis self-assigned this Jun 26, 2025
@pkoutsovasilis pkoutsovasilis added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-active-all Automated backport with mergify to all the active branches labels Jun 26, 2025
@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review June 27, 2025 06:22
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner June 27, 2025 06:22
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

ycombinator
ycombinator previously approved these changes Jun 27, 2025
@ycombinator
Copy link
Contributor

Please also update https://github.com/elastic/elastic-agent/blob/main/docs/test-framework-dev-guide.md#running-the-tests but maybe we should mention something more generic there and ask developers to rely on mage -l instead of spelling out every single possible integration testing target?

pchila
pchila previously approved these changes Jun 30, 2025
@pchila
Copy link
Member

pchila commented Jun 30, 2025

Please also update https://github.com/elastic/elastic-agent/blob/main/docs/test-framework-dev-guide.md#running-the-tests but maybe we should mention something more generic there and ask developers to rely on mage -l instead of spelling out every single possible integration testing target?

Maybe we should start deprecating the old mage:integration* targets also for local dev (we barely use them in CI anyways) and provide better alternatives to spin up stacks and run tests ?

@pkoutsovasilis pkoutsovasilis dismissed stale reviews from pchila and ycombinator via 5440b52 July 2, 2025 05:21
@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @pkoutsovasilis

@pkoutsovasilis pkoutsovasilis merged commit 2ec9992 into elastic:main Jul 2, 2025
19 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2025

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

@mergify
Copy link
Contributor

mergify bot commented Jul 2, 2025

mergify bot pushed a commit that referenced this pull request Jul 2, 2025
* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)
pkoutsovasilis added a commit that referenced this pull request Jul 2, 2025
#8791)

* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis added a commit that referenced this pull request Jul 2, 2025
#8790)

* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis added a commit that referenced this pull request Jul 2, 2025
#8788)

* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis added a commit that referenced this pull request Jul 2, 2025
#8787)

* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis added a commit that referenced this pull request Jul 2, 2025
#8789)

* feat: support running a single test for serverless and resource leak integration tests

* doc: update test-framework-dev-guide.md to include the latest mage targets

(cherry picked from commit 2ec9992)

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
v1v added a commit to v1v/elastic-agent that referenced this pull request Jul 6, 2025
…ng-oblt-cli

* upstream: (37 commits)
  [AutoOps] Add `autoops-es.yml` to Packages (elastic#8728)
  EDOT collector: include the forward connector. (elastic#8753)
  Revert "ci: pin elastic-agent version (elastic#8736)" (elastic#8754)
  bk: retry Start ESS stack for integration tests (elastic#8553)
  Re-enable TestStandaloneUpgradeRollbackOnRestarts on windows (elastic#8718)
  removed reviewers from dependabot.yml (elastic#8709)
  Pass `--header` enrollment option to fleet-server (elastic#8071)
  Add ability for local output configuration to add to policy configuration (elastic#8766)
  Bump up github.com/go-viper/mapstructure/v2 dependency (elastic#8764)
  [Synthetics] Upgrade node to latest lts v20 (elastic#8712)
  [CI] BK Vault plugin for EC access (elastic#8377)
  feat: singleTest mage target for each integration test package (elastic#8691)
  ci: always include 8.19 LTS release branch in snapshots of test versions (elastic#8761)
  build(deps): bump github.com/elastic/mito from 1.19.0 to 1.20.0 (elastic#8755)
  chore: fix elastic-agent helm chart examples (elastic#8765)
  feat: support onboarding-id for kubernetes (elastic#8692)
  [main][Automation] Bump VM Image version to 1751072471 (elastic#8734)
  ci: revert deployment_csp_configuration.yaml to create_deployment_csp_configuration.yaml (elastic#8746)
  kustomize: pin kube-state-metrics version (elastic#8739)
  ci: pin elastic-agent version (elastic#8736)
  ...
v1v added a commit that referenced this pull request Jul 6, 2025
* upstream: (39 commits)
  Fix otel extension status reporting (#8696)
  Refactor user change on service (#8347)
  [AutoOps] Add `autoops-es.yml` to Packages (#8728)
  EDOT collector: include the forward connector. (#8753)
  Revert "ci: pin elastic-agent version (#8736)" (#8754)
  bk: retry Start ESS stack for integration tests (#8553)
  Re-enable TestStandaloneUpgradeRollbackOnRestarts on windows (#8718)
  removed reviewers from dependabot.yml (#8709)
  Pass `--header` enrollment option to fleet-server (#8071)
  Add ability for local output configuration to add to policy configuration (#8766)
  Bump up github.com/go-viper/mapstructure/v2 dependency (#8764)
  [Synthetics] Upgrade node to latest lts v20 (#8712)
  [CI] BK Vault plugin for EC access (#8377)
  feat: singleTest mage target for each integration test package (#8691)
  ci: always include 8.19 LTS release branch in snapshots of test versions (#8761)
  build(deps): bump github.com/elastic/mito from 1.19.0 to 1.20.0 (#8755)
  chore: fix elastic-agent helm chart examples (#8765)
  feat: support onboarding-id for kubernetes (#8692)
  [main][Automation] Bump VM Image version to 1751072471 (#8734)
  ci: revert deployment_csp_configuration.yaml to create_deployment_csp_configuration.yaml (#8746)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce singleTest mage target for each integration test package

4 participants