* added a new CI file, migrated testing information to it, and enhanced the README * simplify CI.md to match kubernetes.core format * rewrite CI file to reflect zuul and prow testing
3.2 KiB
Continuous Integration (CI)
This collection uses two CI systems: Zuul for PR validation checks and Prow for integration testing.
Zuul - PR Validation
Zuul runs automated tests on every pull request. The Zuul configuration for this collection is defined in the ansible/ansible-zuul-jobs repository under the ansible-collections-community-okd template.
Jobs Run by Zuul
The following jobs run in the third-party-check pipeline on every PR:
| Job | Description |
|---|---|
build-ansible-collection |
Builds the collection tarball |
ansible-galaxy-importer |
Validates collection structure for Galaxy (non-voting) |
ansible-tox-linters |
Runs black, flake8, and ansible-lint via tox -e linters (see tox.ini) |
ansible-test-units-community-okd-python39 |
Executes unit tests with Python 3.9 |
Upstream Sanity Tests:
ansible-test-sanity-docker-develansible-test-sanity-docker-milestoneansible-test-sanity-docker-stable-2.16ansible-test-sanity-docker-stable-2.17ansible-test-sanity-docker-stable-2.18
Downstream Sanity Tests (test the redhat.openshift variant):
ansible-test-sanity-okd-downstream-develansible-test-sanity-okd-downstream-milestoneansible-test-sanity-okd-downstream-stable-2.16ansible-test-sanity-okd-downstream-stable-2.17ansible-test-sanity-okd-downstream-stable-2.18
OpenShift Prow - Integration Testing
Integration tests for community.okd are executed via OpenShift Prow, OpenShift's CI/CD system for testing against live clusters.
Prow Configuration
The Prow configuration for this collection is maintained in the openshift/release repository at ci-operator/config/openshift/community.okd/openshift-community.okd-main.yaml.
Integration Test Workflow
The integration test workflow follows these steps:
-
Prow builds the test runner image defined in ci/Dockerfile
- Based on
registry.access.redhat.com/ubi9/ubi - Includes Python 3.12, ansible-core, molecule, kubernetes client, and OKD CLI tools
- Based on
-
Prow executes
make test-integration-incluster- This runs ci/incluster_integration.sh
-
The script spawns a Kubernetes Job that runs
make test-integrationusing the previously built image- Job runs with cluster-admin permissions
- 30-minute timeout
- Backoff limit of 2 retries
-
make test-integrationruns both upstream and downstream tests:- Upstream tests (
upstream-test-integration): Runs molecule tests forcommunity.okdcollection - Downstream tests (
downstream-test-integration): Runsci/downstream.sh -ito convert the collection toredhat.openshiftand test the downstream variant
- Upstream tests (
Test Framework
Integration tests use the Molecule framework and require a live OpenShift or Kubernetes cluster (>=1.24). Tests are located in the molecule/default/ directory and cover check mode, creation, idempotency, modification, and deletion scenarios.