Skip to content

Commit

Permalink
test: adapt testing to RHEL 9.4
Browse files Browse the repository at this point in the history
- Disable downloading of build cache.
- Disable uploading of results to cache.
- Add build tags to exclude the btrfs graphdriver for the container
  dependencies.
- Remove awscli2 and btrfs-progs-devel from the install dependencies
  script (not available on RHEL).
- Remove the check-build-coverage step in gitlab-ci.  It requires
  reading the build cache.
  • Loading branch information
achilleas-k committed Oct 21, 2024
1 parent edf1d7c commit 64135d3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 60 deletions.
20 changes: 2 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ stages:
- build
- ostree-gen
- ostree-build
- verify
- finish

variables:
Expand All @@ -21,21 +20,6 @@ init:
script:
- schutzbot/update_github_status.sh start

check-build-coverage:
stage: verify
extends: .terraform
variables:
RUNNER: aws/rhel-9.4-ga-x86_64
INTERNAL_NETWORK: "true"
PYTHONUNBUFFERED: 1
script:
- sudo ./test/scripts/install-dependencies
- ./test/scripts/check-build-coverage ./s3configs/
cache:
key: testcache
paths:
- .cache/osbuild-images

finish:
stage: finish
dependencies: []
Expand Down Expand Up @@ -200,7 +184,7 @@ generate-manifests-rhel-9.4-ppc64le:
script:
- sudo ./test/scripts/setup-osbuild-repo
- sudo ./test/scripts/install-dependencies
- go run ./cmd/gen-manifests --arches ppc64le --distros rhel-9.4 --workers 10 --metadata=false --output ./manifests
- go run -tags=exclude_graphdriver_btrfs ./cmd/gen-manifests --arches ppc64le --distros rhel-9.4 --workers 10 --metadata=false --output ./manifests
- for manifest in ./manifests/*; do
if osbuild --inspect $manifest > output; then
echo "$manifest OK";
Expand All @@ -219,7 +203,7 @@ generate-manifests-rhel-9.4-s390x:
script:
- sudo ./test/scripts/setup-osbuild-repo
- sudo ./test/scripts/install-dependencies
- go run ./cmd/gen-manifests --arches s390x --distros rhel-9.4 --workers 10 --metadata=false --output ./manifests
- go run -tags=exclude_graphdriver_btrfs ./cmd/gen-manifests --arches s390x --distros rhel-9.4 --workers 10 --metadata=false --output ./manifests
- for manifest in ./manifests/*; do
if osbuild --inspect $manifest > output; then
echo "$manifest OK";
Expand Down
18 changes: 6 additions & 12 deletions test/scripts/boot-image
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,12 @@ def main():

print(f"Testing image at {image_path}")
bib_image_id = ""
match image_type:
case "ami" | "ec2" | "ec2-ha" | "ec2-sap" | "edge-ami":
boot_ami(distro, arch, image_type, image_path, build_config_path)
case "iot-bootable-container":
manifest_id = build_info["manifest-checksum"]
boot_container(distro, arch, image_type, image_path, manifest_id)
bib_ref = testlib.get_bib_ref()
bib_image_id = testlib.skopeo_inspect_id(f"docker://{bib_ref}", testlib.host_container_arch())
case _:
# skip
print(f"{image_type} boot tests are not supported yet")
return
if image_type in ("ami", "ec2", "ec2-ha", "ec2-sap", "edge-ami"):
boot_ami(distro, arch, image_type, image_path, build_config_path)
else:
# skip
print(f"{image_type} boot tests are not supported yet")
return

print("✅ Marking boot successful")
# amend build info with boot success
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/build-image
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main():
print(json.dumps(config, indent=2))
config_name = config["name"]

testlib.runcmd(["go", "build", "-o", "./bin/build", "./cmd/build"])
testlib.runcmd(["go", "build", "-tags=exclude_graphdriver_btrfs", "-o", "./bin/build", "./cmd/build"])

cmd = ["sudo", "-E", "./bin/build", "--output", "./build",
"--distro", distro, "--image", image_type, "--config", config_path]
Expand Down
1 change: 0 additions & 1 deletion test/scripts/generate-build-config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ build/{distro}/{arch}/{image_type}/{config_name}:
- sudo ./test/scripts/install-dependencies
- ./test/scripts/build-image "{distro}" "{image_type}" "{config}"
- ./test/scripts/boot-image "{distro}" "{arch}" "{image_type}" "{image_path}"
- ./test/scripts/upload-results "{distro}" "{image_type}" "{config}"
extends: .terraform
variables:
RUNNER: aws/rhel-9.4-ga-{arch}
Expand Down
18 changes: 1 addition & 17 deletions test/scripts/generate-gitlab-ci
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ stages:
- build
- ostree-gen
- ostree-build
- verify
- finish
variables:
Expand All @@ -32,21 +31,6 @@ init:
script:
- schutzbot/update_github_status.sh start
check-build-coverage:
stage: verify
extends: .terraform
variables:
RUNNER: aws/rhel-9.4-ga-x86_64
INTERNAL_NETWORK: "true"
PYTHONUNBUFFERED: 1
script:
- sudo ./test/scripts/install-dependencies
- ./test/scripts/check-build-coverage ./s3configs/
cache:
key: testcache
paths:
- .cache/osbuild-images
finish:
stage: finish
dependencies: []
Expand Down Expand Up @@ -143,7 +127,7 @@ generate-manifests-{distro}-{arch}:
script:
- sudo ./test/scripts/setup-osbuild-repo
- sudo ./test/scripts/install-dependencies
- go run ./cmd/gen-manifests --arches {arch} --distros {distro} --workers 10 --metadata=false --output ./manifests
- go run -tags=exclude_graphdriver_btrfs ./cmd/gen-manifests --arches {arch} --distros {distro} --workers 10 --metadata=false --output ./manifests
- for manifest in ./manifests/*; do
if osbuild --inspect $manifest > output; then
echo "$manifest OK";
Expand Down
1 change: 0 additions & 1 deletion test/scripts/generate-ostree-build-config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ build/{distro}/{arch}/{image_type}/{config_name}:
- {start_container}
- ./test/scripts/build-image "{distro}" "{image_type}" "{config}"
- ./test/scripts/boot-image "{distro}" "{arch}" "{image_type}" "{image_path}"
- ./test/scripts/upload-results "{distro}" "{image_type}" "{config}"
extends: .terraform
variables:
RUNNER: aws/rhel-9.4-ga-{arch}
Expand Down
14 changes: 6 additions & 8 deletions test/scripts/imgtestlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def list_images(distros=None, arches=None, images=None):
images_arg = "*"
if images:
images_arg = ",".join(images)
out, _ = runcmd(["go", "run", "./cmd/list-images", "--json",
out, _ = runcmd(["go", "run", "-tags=exclude_graphdriver_btrfs", "./cmd/list-images", "--json",
"--distros", distros_arg, "--arches", arches_arg, "--images", images_arg])
return json.loads(out)

Expand Down Expand Up @@ -201,7 +201,9 @@ def check_config_names():
def gen_manifests(outputdir, config_map=None, distros=None, arches=None, images=None,
commits=False, skip_no_config=False):
# pylint: disable=too-many-arguments
cmd = ["go", "run", "./cmd/gen-manifests",
cmd = ["go", "run",
"-tags=exclude_graphdriver_btrfs",
"./cmd/gen-manifests",
"--cache", os.path.join(TEST_CACHE_ROOT, "rpmmd"),
"--output", outputdir,
"--workers", "100"]
Expand Down Expand Up @@ -316,12 +318,8 @@ def filter_builds(manifests, distro=None, arch=None, skip_ostree_pull=True):
os.makedirs(dl_path, exist_ok=True)
build_requests = []

out, dl_ok = dl_build_info(dl_path, distro=distro, arch=arch)
# continue even if the dl failed; will build all configs
if dl_ok:
# print output which includes list of downloaded files for CI job log
print(out)

# NOTE: disabled cache download for RHEL because there no aws-cli, the build matrix is smaller, and we wont be
# making many PRs to the branch.
osbuild_ver = get_osbuild_nevra()

errors: list[str] = []
Expand Down
2 changes: 0 additions & 2 deletions test/scripts/install-dependencies
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash

dnf -y install \
awscli2 \
btrfs-progs-devel \
device-mapper-devel \
gcc \
go \
Expand Down

0 comments on commit 64135d3

Please sign in to comment.