From 12fef7b7b7b7f0d39feff5833e0fc528acf71bc8 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Sat, 13 Nov 2021 14:01:16 -0600 Subject: [PATCH 1/8] Add wrapper script --- run-openqa-tests.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 run-openqa-tests.sh diff --git a/run-openqa-tests.sh b/run-openqa-tests.sh new file mode 100755 index 00000000..3f2684da --- /dev/null +++ b/run-openqa-tests.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e + +ROCKY_FLAVOR=$1 +ROCKY_VERSION=8.5 +ROCKY_ARCH=x86_64 +ROCKY_PACKAGE_SET=minimal +BUILD_PREFIX="8.5_RC1_$ROCKY_FLAVOR" +BUILD_NAME="${BUILD_PREFIX}_$(date +%Y%m%d.%H%M%S).0" + +if [[ "$ROCKY_FLAVOR" == "dvd-iso" || "$ROCKY_FLAVOR" == "universal" ]]; then + ISO_TYPE=dvd1 +elif [[ "$ROCKY_FLAVOR" == "minimal-iso" ]]; then + ISO_TYPE=minimal +elif [[ "$ROCKY_FLAVOR" == "boot-iso" ]]; then + ISO_TYPE=boot +else + echo "Usage: $0 [universal|dvd-iso|minimal-iso|boot-iso]" + exit 1 +fi + +set -o xtrace +openqa-cli api \ + -X POST isos \ + ISO="Rocky-$ROCKY_VERSION-$ROCKY_ARCH-$ISO_TYPE.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR="$ROCKY_FLAVOR" \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_NAME" \ + PACKAGE_SET="$ROCKY_PACKAGE_SET" \ + IDENTIFICATION=false -- 2.43.5 From 84a1d9440d2b9ef6e7c02462952bcbf5a2159021 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Sat, 13 Nov 2021 14:09:28 -0600 Subject: [PATCH 2/8] Default build name uses ROCKY_VERSION --- run-openqa-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-openqa-tests.sh b/run-openqa-tests.sh index 3f2684da..109257b1 100755 --- a/run-openqa-tests.sh +++ b/run-openqa-tests.sh @@ -5,7 +5,7 @@ ROCKY_FLAVOR=$1 ROCKY_VERSION=8.5 ROCKY_ARCH=x86_64 ROCKY_PACKAGE_SET=minimal -BUILD_PREFIX="8.5_RC1_$ROCKY_FLAVOR" +BUILD_PREFIX="${ROCKY_VERSION}_${ROCKY_FLAVOR}" BUILD_NAME="${BUILD_PREFIX}_$(date +%Y%m%d.%H%M%S).0" if [[ "$ROCKY_FLAVOR" == "dvd-iso" || "$ROCKY_FLAVOR" == "universal" ]]; then -- 2.43.5 From b9bd20fab0a30fba164a6b4fde14adc6d1d10ca8 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Sun, 14 Nov 2021 18:29:45 -0600 Subject: [PATCH 3/8] Wrapper script to print simple build report in Markdown format --- build-report.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 build-report.sh diff --git a/build-report.sh b/build-report.sh new file mode 100755 index 00000000..b40e5059 --- /dev/null +++ b/build-report.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +BUILD_NAME=$1 + +printf 'Test | Result\n=============\n' +openqa-cli api -X GET jobs build="$BUILD_NAME" | \ + jq -r '.jobs[] | {name,result} | join(" | ") | split("-") | last' | \ + sort -- 2.43.5 From f47268e7d4b5a8609b5d27c3084787a746edc478 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Sun, 14 Nov 2021 19:01:00 -0600 Subject: [PATCH 4/8] Some openqa-cli example commands --- EXAMPLES.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 EXAMPLES.md diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 00000000..7412eaa0 --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,16 @@ +## Query all jobs from a named build + + openqa-cli api -X GET jobs build=$BUILDNAME + +## Failed jobs in a named build +The overview on the openQA home page counts incompletes as failures + + openqa-cli api -X GET jobs build=$BUILDNAME result=failed,incomplete + +## Print a simple report of all tests and their results from a named build + + openqa-cli api -X GET jobs build=$BUILDNAME | jq -r '.jobs[] | {name,result} | join(" ") | split("-") | last' | sort + +## Further Reading +[openqa-cli cheat sheet](https://openqa-bites.github.io/openqa/openqa-cli-cheat-sheet/) +[jq cheat sheet](https://lzone.de/cheat-sheet/jq) -- 2.43.5 From 6b67dd19d82fadf3575f0c2c54af1aeda4685353 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Sun, 14 Nov 2021 20:44:00 -0600 Subject: [PATCH 5/8] Include BUILD_NAME in report header --- build-report.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-report.sh b/build-report.sh index b40e5059..b8f6c77d 100755 --- a/build-report.sh +++ b/build-report.sh @@ -3,7 +3,7 @@ set -e BUILD_NAME=$1 -printf 'Test | Result\n=============\n' +printf '# %s\nTest | Result\n=============\n' "$BUILD_NAME" openqa-cli api -X GET jobs build="$BUILD_NAME" | \ jq -r '.jobs[] | {name,result} | join(" | ") | split("-") | last' | \ sort -- 2.43.5 From a855f9cda3214886853a34c5777daa5bf926e229 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Mon, 15 Nov 2021 16:40:10 -0600 Subject: [PATCH 6/8] Additional columns --- build-report.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-report.sh b/build-report.sh index b8f6c77d..0af08b65 100755 --- a/build-report.sh +++ b/build-report.sh @@ -3,7 +3,10 @@ set -e BUILD_NAME=$1 -printf '# %s\nTest | Result\n=============\n' "$BUILD_NAME" +printf '# %s\n' "$BUILD_NAME" +printf "| Test | Result | Failure Reason | Effort to Fix | Notes |\n" +printf "| ---- | ------ | -------------- | ------------- | ----- |\n" + openqa-cli api -X GET jobs build="$BUILD_NAME" | \ jq -r '.jobs[] | {name,result} | join(" | ") | split("-") | last' | \ sort -- 2.43.5 From fb735448781cd53d434246907e0b008d17a8ba75 Mon Sep 17 00:00:00 2001 From: akatch Date: Mon, 15 Nov 2021 17:01:08 -0600 Subject: [PATCH 7/8] Extra hyphen --- build-report.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-report.sh b/build-report.sh index 0af08b65..f75c4147 100755 --- a/build-report.sh +++ b/build-report.sh @@ -5,7 +5,7 @@ BUILD_NAME=$1 printf '# %s\n' "$BUILD_NAME" printf "| Test | Result | Failure Reason | Effort to Fix | Notes |\n" -printf "| ---- | ------ | -------------- | ------------- | ----- |\n" +printf "| ---- | ------ | -------------- | ------------ | ----- |\n" openqa-cli api -X GET jobs build="$BUILD_NAME" | \ jq -r '.jobs[] | {name,result} | join(" | ") | split("-") | last' | \ -- 2.43.5 From dfb7232f28b0378051c4159adba2057b3ec73cac Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Tue, 16 Nov 2021 01:57:02 -0600 Subject: [PATCH 8/8] Added @tcooper's suggestion --- build-report.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-report.sh b/build-report.sh index f75c4147..8edc978a 100755 --- a/build-report.sh +++ b/build-report.sh @@ -3,10 +3,11 @@ set -e BUILD_NAME=$1 -printf '# %s\n' "$BUILD_NAME" +printf '# Build%s\n' "$BUILD_NAME" printf "| Test | Result | Failure Reason | Effort to Fix | Notes |\n" printf "| ---- | ------ | -------------- | ------------ | ----- |\n" openqa-cli api -X GET jobs build="$BUILD_NAME" | \ jq -r '.jobs[] | {name,result} | join(" | ") | split("-") | last' | \ - sort + sort | \ + sed 's,^,| ,g;s,$, | | | |,g' -- 2.43.5