From ba320c9ea0888ee3122844d765a004909af868e6 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Wed, 1 Dec 2021 17:27:46 +0100 Subject: [PATCH] test/api: update database query for getting job result - Filter on manifest-id-only type jobs - Save entire result Co-authored-by: Sanne Raymaekers --- test/cases/api.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cases/api.sh b/test/cases/api.sh index e9b2348b5..07bf99aab 100755 --- a/test/cases/api.sh +++ b/test/cases/api.sh @@ -729,15 +729,15 @@ test "$UPLOAD_STATUS" = "success" test "$UPLOAD_TYPE" = "$CLOUD_PROVIDER" test $((INIT_COMPOSES+1)) = "$SUBS_COMPOSES" +# Disable -x for these commands to avoid printing the whole result and manifest into the log +set +x + # Make sure we get 3 job entries in the db per compose (depsolve + manifest + build) sudo podman exec osbuild-composer-db psql -U postgres -d osbuildcomposer -c "SELECT * FROM jobs;" | grep "9 rows" -# -# Save the Manifest from the osbuild-composer store -# NOTE: The rest of the job data can contain sensitive information -# -# Suppressing shellcheck. See https://github.com/koalaman/shellcheck/wiki/SC2024#exceptions -sudo podman exec osbuild-composer-db psql -U postgres -d osbuildcomposer -c "SELECT result->>'Manifest' FROM jobs" | sudo tee "${ARTIFACTS}/manifest.json" +# Save the result, including the manifest, for the job, straight from the db +sudo podman exec osbuild-composer-db psql -U postgres -d osbuildcomposer -c "SELECT result FROM jobs WHERE type='manifest-id-only'" | sudo tee "${ARTIFACTS}/build-result.txt" +set -x # # Verify the Cloud-provider specific upload_status options