Skip to content

Commit

Permalink
fix(tests): make resources test more resilient
Browse files Browse the repository at this point in the history
It currently breaks because it exceeds the possible length of a bash var
  • Loading branch information
lengau committed Jul 16, 2024
1 parent 4ff7cee commit ab55b46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/spread/store/resources/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ execute: |
# upload and verify the file resource
upload_revision_number=$(charmcraft upload-resource $CHARM_DEFAULT_NAME example-file --format=json --file=resourcefile.txt --arch=amd64,riscv64 | jq -r '.revision')
revisions_json=$(charmcraft resource-revisions $CHARM_DEFAULT_NAME example-file --format=json)
upload_revision=$(echo "$revisions_json" | jq -c ".[] | select(.revision == $upload_revision_number)" )
charmcraft resource-revisions $CHARM_DEFAULT_NAME example-file --format=json > file_revisions.json
upload_revision=$(cat file_revisions.json | jq -c ".[] | select(.revision == $upload_revision_number)" )
upload_revision_architectures=$(echo "$upload_revision" | jq -c '.bases[0].architectures')
[[ "$upload_revision_architectures" = '["amd64","riscv64"]' ]]
last_revision=$(echo "$revisions_json" | jq -r .[-1])
last_revision=$(cat file_revisions.json | jq -r .[-1])
last_file_revno=$(echo $last_revision | jq .revision)
[[ "$upload_revision_number" -le "$last_file_revno" ]]
last_revision_created=$(echo $last_revision | jq -r .created_at)
Expand Down

0 comments on commit ab55b46

Please sign in to comment.