Skip to content

Prepare for testing with spread#28

Merged
addyess merged 6 commits intoproject-bootstrapfrom
test/spread-scaffold
Mar 3, 2026
Merged

Prepare for testing with spread#28
addyess merged 6 commits intoproject-bootstrapfrom
test/spread-scaffold

Conversation

@addyess
Copy link
Contributor

@addyess addyess commented Feb 24, 2026

This pull request updates documentation and workflow files to standardize the terminology and configuration for component-driven tests in the Kubernetes testing infrastructure. The main change is replacing the use-spread flag with a more general test flag, and expanding the repo field to support more flexible repository configurations. These updates improve clarity and flexibility for component test definitions and workflow execution.

Manifest and Component Configuration Changes:

  • Replaced all instances of the use-spread flag with the test flag in documentation, YAML examples, and workflow instructions, clarifying that components providing tests should use test: true. [1] [2] [3] [4] [5] [6] [7]
  • Expanded the repo field in component manifests from a simple string to an object supporting base-url, subdir, and ref, enabling monorepo support and flexible branch/tag selection. [1] [2] [3]

Workflow and CLI Usage Updates:

  • Updated workflow files and CLI usage examples to use the new manifest structure and test flag, including changes to test execution commands and artifact paths. [1] [2]

Tooling and Environment Setup:

  • Added steps to the GitHub Actions workflow to install Go, the Spread testing tool, and set up LXD, ensuring the required environment for component-driven spread tests.

Documentation Cleanup:

  • Removed references to the deprecated hook_config property in component class documentation, simplifying configuration property access. [1] [2] [3]

@addyess addyess force-pushed the test/spread-scaffold branch from b6bfb1c to c77778a Compare February 24, 2026 22:55
@addyess addyess force-pushed the test/spread-scaffold branch 4 times, most recently from 9ca1d08 to c840636 Compare February 25, 2026 19:43
@addyess addyess force-pushed the test/spread-scaffold branch 15 times, most recently from 4f4a76b to 9160e63 Compare March 3, 2026 15:24
@addyess addyess force-pushed the test/spread-scaffold branch from 9160e63 to e5a98d7 Compare March 3, 2026 20:33
@addyess addyess marked this pull request as ready for review March 3, 2026 21:16
Copilot AI review requested due to automatic review settings March 3, 2026 21:16
Copy link
Contributor

Copilot AI left a comment

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 refactors the manifest schema and component configuration to support spread-based component tests, and wires a new kube-galaxy test flow that orchestrates spread suites from a shared tests directory.

Changes:

  • Replace use-spread with test and change repo from a string to a structured RepoInfo object in manifests/models/loader.
  • Add spread test orchestration (template + generator + runner) including kubeconfig sharing and per-component namespace lifecycle.
  • Update CLI/workflow/tests to the new schema and to pass arch_info into component instances.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/unit/test_validator.py Updates spread component discovery test to use temp tests_root and test flag.
tests/unit/test_models.py Updates model unit test from use_spread to test.
tests/unit/test_loader.py Updates loader unit test expectations to test flag.
tests/unit/conftest.py Updates sample manifest YAML to new repo.base-url shape; adds arch_info fixture.
tests/unit/components/test_kubelet.py Updates component config construction to use RepoInfo and inject arch_info.
tests/unit/components/test_kubeadm.py Updates component config construction to use RepoInfo and inject arch_info.
tests/unit/components/test_container_manifest.py Updates tests for new RepoInfo and arch_info plumbing.
tests/unit/components/test_base_utils.py Updates base utils tests for RepoInfo and new download_filename_from_config() signature.
tests/spread.yaml Removes the repository-level spread config in favor of generated orchestration config.
src/kube_galaxy/pkg/utils/components.py Introduces format_component_pattern() and removes GitHub-specific URL builder.
src/kube_galaxy/pkg/testing/templates/spread.yaml.tmpl Adds a spread.yaml template for orchestration.
src/kube_galaxy/pkg/testing/spread.py Implements spread orchestration, kubeconfig sharing, namespace lifecycle, and execution.
src/kube_galaxy/pkg/manifest/validator.py Adds test task path helper and basic validation for component test structure.
src/kube_galaxy/pkg/manifest/models.py Adds RepoInfo, replaces use_spread with test, adds InstallMethod.NONE.
src/kube_galaxy/pkg/manifest/loader.py Parses new repo object, defaults install method to none, reads test flag.
src/kube_galaxy/pkg/literals.py Adds tests paths and timeouts; replaces manifest field constant with TEST.
src/kube_galaxy/pkg/components/sonobuoy.py Adds a test-only Sonobuoy component that writes a spread task.
src/kube_galaxy/pkg/components/kubeadm.py Adjusts kubeadm init config to clear node taints.
src/kube_galaxy/pkg/components/containerd.py Updates pause image resolution and uses shared pattern formatter.
src/kube_galaxy/pkg/components/_base.py Makes arch_info required, centralizes pattern formatting, adds InstallMethod.NONE handling.
src/kube_galaxy/pkg/cluster.py Ensures arch_info is passed when instantiating components; tweaks stage numbering.
src/kube_galaxy/cmd/validate.py Removes the old validate command handler module.
src/kube_galaxy/cmd/test.py Reworks test command to spread(manifest_path) and moves validate logic here.
src/kube_galaxy/cli.py Simplifies CLI commands; changes test and validate wiring and signatures.
manifests/smoktest.yaml Migrates to repo.base-url; adds sonobuoy as a test-only component.
manifests/baseline-k8s-1.36.yaml Migrates to repo.base-url schema.
manifests/baseline-k8s-1.35.yaml Migrates to repo.base-url schema.
manifests/baseline-k8s-1.34.yaml Migrates to repo.base-url schema.
manifests/baseline-k8s-1.33.yaml Migrates to repo.base-url schema.
docs/spread-based-component-tests-prompt.md Adds a design/plan document for spread-based component tests.
docs/component-lifecycle-hooks.md Removes references to now-removed hook config accessors.
docs/class-based-components.md Removes hook-config section/docs that no longer match models.
README.md Updates examples/docs for repo object and test flag.
.github/workflows/test-baseline-clusters.yml Installs spread + LXD and runs kube-galaxy test <manifest>; uploads logs/.
.github/copilot-instructions.md Updates schema references but still contains outdated CLI examples.
.github/ARCHITECTURE.md Updates narrative references from use-spread to test.

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

You can also share your feedback on Copilot code review. Take the survey.

@canonical canonical deleted a comment from Copilot AI Mar 3, 2026
@addyess addyess merged commit c3c2616 into project-bootstrap Mar 3, 2026
7 checks passed
@addyess addyess deleted the test/spread-scaffold branch March 3, 2026 22:36
addyess added a commit that referenced this pull request Mar 5, 2026
* Bootstrap project

* Test `single-node-no-cni` manifest in PR (#1)

Scaffold out the project to create kubeadm clusters on PRs and verify their installation. 
* Missing custom installation of kubernetes container services
* Missing implementation of spread tests

* Reduce sudo usage and exec calls (#20)

* Install cni-plugins before kubelet starts (#21)

* Understand why gh runners don't need cni-plugins

* Create component for cni-plugins

* Remove early debug

* handle all installation methods

* Address review comments

* Import images via pull or import (#22)

* Begin to implement image pull

* Adjust hooks to not need arch passed

* Bind kubeadm bootstrap to pre-pulled images defined by the manifest

* Address review comments

* Dynamic hook execution

* Update src/kube_galaxy/pkg/components/kubeadm.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address review comments

* Golf

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove unused fields from manifest and components (#23)

* Tidy up more of the components (#24)

* Tidy up more of the components

* Review comment

* Parallelize image pulls and install (#25)

* First shot deploying with a calico CNI (#26)

* First shots deploying with a calico CNI

* Validate manifest applications

* Validate kube-system is deployed

* Update tests/unit/components/test_container_manifest.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply review comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Prepare for testing with spread (#28)

* Prepare for testing with spread

* Ready CNCF validation

* Prepared a Sonobouy component

* Kubeadm bootstraps with no node taints

* Review comments

* Single out the kube-galaxy tasks from each component's spread suite.

* Update implementation to match documentation (#30)

* Rollup kubectl commands to a common library (#31)

* Rollup kubectl commands to a common library

* Apply review comments

* Additional unit tests

* Apply review comments

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants