debian-forge-composer/.gitlab-ci.yml
Tomas Hozza c5a4946135 Test all manifests with depsolved package sets
Generated image test case manifests for all supported distros, arches and
image-types are being tested as part of distro unit tests. However due
to time constrains, the unit test does not depsolve the image's default
package sets and thus does not check if they changed in the internal
osbuild-composer's representation, compared to the generated image test
case.

Extend the `TestDistro_Manifest()` function used by the unit test to
allow depsolving image's package sets.

Introduce a new test case binary `osbuild-composer-manifest-tests`
allowing to check the manifests generated by composer for all supported
combinations of images against generated manifests, including depsolving
image's default package sets.

Introduce a new CI test case `manifest_tests.sh` executing the
`osbuild-composer-manifest-tests` binary and testing all existing image
test cases. Run it in CI on RHEL-9 runner.

Modify SPEC file to ship the newly added test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-11-19 19:50:25 +01:00

424 lines
12 KiB
YAML

stages:
- init
- rpmbuild
- prepare-rhel-internal
- test
- cleanup
- finish
.base:
after_script:
- schutzbot/update_github_status.sh update
- schutzbot/save_journal.sh
- schutzbot/run_cloud_cleaner.sh
tags:
- terraform
artifacts:
paths:
- journal-log.gpg
- ci-artifacts
when: always
.terraform:
extends: .base
tags:
- terraform
.terraform/openstack:
extends: .base
tags:
- terraform/openstack
init:
stage: init
tags:
- shell
script:
- schutzbot/update_github_status.sh start
RPM:
stage: rpmbuild
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
script:
- sh "schutzbot/mockbuild.sh"
after_script:
- schutzbot/update_github_status.sh update
- schutzbot/save_journal.sh
artifacts:
paths:
- journal-log.gpg
parallel:
matrix:
- RUNNER:
- aws/fedora-33-x86_64
- aws/fedora-33-aarch64
- aws/fedora-34-x86_64
- aws/fedora-34-aarch64
- aws/rhel-8.4-ga-x86_64
- aws/rhel-8.4-ga-aarch64
- aws/centos-stream-8-x86_64
- aws/centos-stream-8-aarch64
- RUNNER:
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-8.6-nightly-aarch64
- aws/rhel-9.0-nightly-x86_64
- aws/rhel-9.0-nightly-aarch64
INTERNAL_NETWORK: ["true"]
Container:
stage: rpmbuild
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
script:
- sh "schutzbot/containerbuild.sh"
parallel:
matrix:
- RUNNER:
- aws/fedora-33-x86_64
Prepare-rhel-internal:
stage: prepare-rhel-internal
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/prepare-rhel-internal.sh
artifacts:
paths:
- rhel-${RHEL_MAJOR}.json
- rhel${RHEL_MAJOR}internal.repo
- rhel-${RHEL_MAJOR}-beta.json
- COMPOSE_ID
parallel:
matrix:
- RUNNER:
# NOTE: 1 runner prepares for all arches b/c subsequent jobs download
# artifacts from all previous jobs and the last one wins
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-9.0-nightly-x86_64
INTERNAL_NETWORK: ["true"]
Base:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/base_tests.sh
parallel:
matrix:
- RUNNER:
- aws/fedora-33-x86_64
- aws/fedora-33-aarch64
# See COMPOSER-919
# - aws/fedora-34-x86_64
# - aws/fedora-34-aarch64
- aws/rhel-8.4-ga-x86_64
- aws/rhel-8.4-ga-aarch64
- aws/centos-stream-8-x86_64
- aws/centos-stream-8-aarch64
- RUNNER:
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-8.6-nightly-aarch64
- aws/rhel-9.0-nightly-x86_64
- aws/rhel-9.0-nightly-aarch64
INTERNAL_NETWORK: ["true"]
artifacts:
paths:
- journal-log.gpg
- "*.repo"
when: always
Manifests:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/manifest_tests.sh
parallel:
matrix:
- RUNNER:
- aws/rhel-9.0-nightly-x86_64
INTERNAL_NETWORK: ["true"]
artifacts:
paths:
- journal-log.gpg
- "*.repo"
when: always
Regression:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/regression.sh
parallel:
matrix:
- RUNNER:
- aws/fedora-33-x86_64
- aws/fedora-33-aarch64
# Enable f34 once we have rpmrepo snapshots for it
- aws/centos-stream-8-x86_64
- aws/centos-stream-8-aarch64
- RUNNER:
- aws/rhel-8.4-ga-x86_64
- aws/rhel-8.4-ga-aarch64
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-8.6-nightly-aarch64
- aws/rhel-9.0-nightly-x86_64
- aws/rhel-9.0-nightly-aarch64
INTERNAL_NETWORK: ["true"]
artifacts:
paths:
- journal-log.gpg
- "*.repo"
when: always
OSTree:
stage: test
extends: .terraform/openstack
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/ostree.sh
parallel:
matrix:
- RUNNER:
- openstack/fedora-33-x86_64
# See COMPOSER-919
# - openstack/fedora-34-x86_64
- openstack/rhel-8.4-ga-x86_64
- openstack/rhel-8.6-nightly-x86_64
- openstack/rhel-9.0-nightly-x86_64
- openstack/centos-stream-8-x86_64
New OSTree:
stage: test
extends: OSTree
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/ostree-ng.sh
parallel:
matrix:
- RUNNER:
- openstack/rhel-8.6-nightly-x86_64-large
- openstack/rhel-9.0-nightly-x86_64-large
- openstack/centos-stream-8-x86_64
OSTree simplified installer:
stage: test
extends: OSTree
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/ostree-simplified-installer.sh
parallel:
matrix:
- RUNNER:
- openstack/rhel-8.6-nightly-x86_64-large
- openstack/centos-stream-8-x86_64
# NOTE: coreos-installer not yet available in RHEL 9.0
# - openstack/rhel-9.0-nightly-x86_64
OSTree raw image:
stage: test
extends: OSTree
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/ostree-raw-image.sh
parallel:
matrix:
- RUNNER:
- openstack/rhel-8.6-nightly-x86_64
- openstack/centos-stream-8-x86_64
- openstack/rhel-9.0-nightly-x86_64
.INTEGRATION_TESTS: &INTEGRATION_TESTS
SCRIPT:
- koji.sh
- aws.sh
- azure.sh
- vmware.sh
- filesystem.sh
- cross-distro.sh
Integration:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/${SCRIPT}
parallel:
matrix:
- <<: *INTEGRATION_TESTS
RUNNER:
- aws/fedora-33-x86_64
# See COMPOSER-919
# - aws/fedora-34-x86_64
# See COMPOSER-1118
# - aws/centos-stream-8-x86_64
- SCRIPT:
- koji.sh
- aws.sh
RUNNER:
- aws/centos-stream-8-x86_64
- <<: *INTEGRATION_TESTS
RUNNER:
- aws/rhel-8.4-ga-x86_64
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-9.0-nightly-x86_64
INTERNAL_NETWORK: ["true"]
- SCRIPT:
- azure_hyperv_gen2.sh
RUNNER:
- aws/rhel-8.6-nightly-x86_64
INTERNAL_NETWORK: ["true"]
.API_TESTS: &API_TESTS
TARGET:
- azure
- aws
- gcp
- aws.s3
API:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/api.sh ${TARGET}
parallel:
matrix:
- <<: *API_TESTS
RUNNER:
- aws/fedora-33-x86_64
# See COMPOSER-919
# - aws/fedora-34-x86_64
# See COMPOSER-1118
# - aws/centos-stream-8-x86_64
- TARGET:
- aws
- gcp
- aws.s3
RUNNER:
- aws/centos-stream-8-x86_64
- <<: *API_TESTS
RUNNER:
- aws/rhel-8.4-ga-x86_64
- aws/rhel-8.6-nightly-x86_64
- aws/rhel-9.0-nightly-x86_64
INTERNAL_NETWORK: ["true"]
libvirt:
stage: test
extends: .terraform/openstack
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/libvirt.sh
parallel:
matrix:
- RUNNER:
- openstack/fedora-33-x86_64
- openstack/centos-stream-8-x86_64
- RUNNER:
- openstack/rhel-8.4-ga-x86_64
- openstack/rhel-8.6-nightly-x86_64
- openstack/rhel-9.0-nightly-x86_64
INTERNAL_NETWORK: ["true"]
RHEL 9 on 8:
stage: test
extends: .terraform
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/koji.sh
variables:
RUNNER: aws/rhel-8.4-ga-x86_64
INTERNAL_NETWORK: "true"
DISTRO_CODE: rhel-90
NIGHTLY_FAIL:
stage: finish
tags:
- shell
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $NIGHTLY == "true"'
when: on_failure
script:
- schutzbot/slack_notification.sh FAILED ":big-sad:"
NIGHTLY_SUCCESS:
stage: finish
tags:
- shell
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $NIGHTLY == "true"'
script:
- schutzbot/slack_notification.sh SUCCESS ":partymeow:"
Installer:
stage: test
extends: .terraform/openstack
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9\.[0-9]-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8\.[0-9]-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"'
script:
- schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/installers.sh
parallel:
matrix:
- RUNNER:
- openstack/rhel-8.6-nightly-x86_64
- openstack/rhel-9.0-nightly-x86_64
SCHEDULED_CLOUD_CLEANER:
stage: cleanup
tags:
- terraform
variables:
RUNNER: aws/fedora-33-x86_64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CLEANUP == "true"'
script:
- schutzbot/deploy.sh
- schutzbot/scheduled_cloud_cleaner.sh
finish:
stage: finish
tags:
- shell
script:
- schutzbot/update_github_status.sh finish