-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] fix gcb e2e #363
base: main
Are you sure you want to change the base?
[test] fix gcb e2e #363
Conversation
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
@@ -193,7 +193,7 @@ e2e_set_payload() { | |||
local this_builder | |||
this_builder=$(e2e_this_builder) | |||
if [[ "${this_builder}" == "gcb" ]]; then | |||
jq -c ".provenance_summary.provenance[0].envelope.payload = \"$(echo "$2" | base64 -w0)\"" <"$1" | |||
jq -c ".provenance_summary.provenance[0].envelope.payload = \"$(echo "$2" | base64 -w0)\"" <"$1" > tmp.json && mv tmp.json "$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to create a file? I think the function needs to print the change, and the caller saves it to file of they want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. something isn't happening correctly here for gcb, then
example-package/.github/workflows/scripts/e2e-verify.common.sh
Lines 540 to 546 in 441e656
echo " **** Wrong payload *****" | |
local bad_prov | |
bad_prov="$(mktemp -t slsa-e2e.XXXXXXXX)" | |
e2e_set_payload "$PROVENANCE" '{"foo": "bar"}' >"${bad_prov}" | |
read -ra badProvenanceArg <<<"$($argr "provenance") ${bad_prov}" | |
$verifierCmd "${artifactAndbuilderMinArgs[@]}" "${branchOpts[@]}" "${badProvenanceArg[@]}" "${packageArg[@]}" "${sourceArg[@]}" "github.com/$GITHUB_REPOSITORY" | |
e2e_assert_not_eq "$?" "0" "wrong payload" |
Like $bad_prov
should actually be $PROVENANCE
Followup to #350
Fixes the tests to correctly edit the payload file, so that this particular test fill fail as expected.
example-package/.github/workflows/scripts/e2e-verify.common.sh
Line 540 in e60c8d2
We may also want to do the same change on the next line, for non-gcb tests
example-package/.github/workflows/scripts/e2e-verify.common.sh
Lines 197 to 198 in e60c8d2
Testing
executed the workflow against this PR's branch
https://github.com/slsa-framework/example-package/actions/runs/8756899306/job/24034397658#step:5:150