Skip to content

Adds basic skeleton and tests for agentmanagement#5373

Merged
0xavi0 merged 2 commits into
rancher:mainfrom
0xavi0:tests-agentmanagement-skeleton-basics
Jul 6, 2026
Merged

Adds basic skeleton and tests for agentmanagement#5373
0xavi0 merged 2 commits into
rancher:mainfrom
0xavi0:tests-agentmanagement-skeleton-basics

Conversation

@0xavi0

@0xavi0 0xavi0 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds basic testing coverage skeleton and tests very basic things done by the agentmanagement component.

Refers to: #5372

Additional Information

Checklist

- [ ] I have updated the documentation via a pull request in the fleet-product-docs repository.

This PR adds basic testing coverage skeleton and tests very basic things
done by the agentmanagement component.

Refers to: rancher#5372

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 added this to the v2.16.0 milestone Jun 30, 2026
@0xavi0 0xavi0 self-assigned this Jun 30, 2026
@0xavi0 0xavi0 added this to Fleet Jun 30, 2026
@0xavi0
0xavi0 marked this pull request as ready for review June 30, 2026 14:46
@0xavi0
0xavi0 requested a review from a team as a code owner June 30, 2026 14:46
Copilot AI review requested due to automatic review settings June 30, 2026 14:46

Copilot AI left a comment

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.

Pull request overview

This PR adds a new envtest-backed Ginkgo integration test suite for the agentmanagement controller set, providing initial “smoke” and bootstrap-resource contract coverage to support future refactors (per #5372).

Changes:

  • Introduces an integrationtests/agentmanagement envtest suite that boots the agentmanagement wrangler controllers.
  • Adds smoke tests asserting the controller harness starts and that bootstrap resources are applied.
  • Adds contract-style tests that validate the exact bootstrap-created namespaces and ClusterRole policy rules.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
integrationtests/agentmanagement/suite_test.go Sets up envtest, seeds config, builds an app context, and registers/starts agentmanagement controllers for the suite.
integrationtests/agentmanagement/smoke_test.go Basic smoke assertions that the harness started and bootstrap resources exist.
integrationtests/agentmanagement/resources_test.go Contract tests for resources.ApplyBootstrapResources outputs (namespaces + exact ClusterRole rules + stability checks).
integrationtests/agentmanagement/helpers_test.go Shared helper assertions/utilities for fetching objects from the envtest API server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

It("starts the controllers without error", func() {
// Reaching here means BeforeSuite completed — envtest started,
// Wrangler controllers registered and started.
Expect(true).To(BeTrue())

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.

Thanks for the comment; I was confused here for a bit 😅

Comment thread integrationtests/agentmanagement/smoke_test.go Outdated
Comment thread integrationtests/agentmanagement/resources_test.go
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@weyfonk weyfonk moved this to 👀 In review in Fleet Jul 6, 2026
@0xavi0
0xavi0 merged commit 93da04c into rancher:main Jul 6, 2026
49 of 51 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Fleet Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants