Skip to content

Commit

Permalink
Improve API checks in CI test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Jun 28, 2024
1 parent 85e1abc commit 70df6bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 15 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/archivematica-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,24 @@ jobs:
podman-compose exec --user root archivematica ln -s /home/ubuntu /home/archivematica
- name: "Call an Archivematica API endpoint"
run: |
curl \
--header "Authorization: ApiKey admin:this_is_the_am_api_key" \
http://localhost:8000/api/processing-configuration/
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_am_api_key' \
--header 'Content-Type: application/json' \
'http://localhost:8000/api/processing-configuration/' \
| jq -r '.processing_configurations == ["automated", "default"]' \
) == true
- name: "Call a Storage Service API endpoint"
run: |
curl \
--header "Authorization: ApiKey admin:this_is_the_ss_api_key" \
http://localhost:8001/api/v2/pipeline/
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_ss_api_key' \
--header 'Content-Type: application/json' \
'http://localhost:8001/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true
- name: "Set up AMAUATs"
working-directory: "${{ github.workspace }}/AMAUATs"
run: |
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/dip-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,34 @@ jobs:
-v
- name: "Call an Archivematica API endpoint"
run: |
curl \
--header "Authorization: ApiKey admin:this_is_the_am_api_key" \
http://localhost:8000/api/processing-configuration/
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_am_api_key' \
--header 'Content-Type: application/json' \
'http://localhost:8000/api/processing-configuration/' \
| jq -r '.processing_configurations == ["automated", "default"]' \
) == true
- name: "Call a Storage Service API endpoint"
run: |
curl \
--header "Authorization: ApiKey admin:this_is_the_ss_api_key" \
http://localhost:8001/api/v2/pipeline/
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_ss_api_key' \
--header 'Content-Type: application/json' \
'http://localhost:8001/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true
- name: "Call an AtoM API endpoint"
run: |
curl \
--header "REST-API-Key: this_is_the_atom_dip_upload_api_key" \
http://localhost:9000/index.php/api/informationobjects
test $( \
curl \
--silent \
--header 'REST-API-Key: this_is_the_atom_dip_upload_api_key' \
--header 'Content-Type: application/json' \
http://localhost:9000/index.php/api/informationobjects \
| jq -r '.results == []' \
) == true
- name: "Create a processing configuration for DIP upload"
working-directory: "${{ github.workspace }}/tests/dip-upload"
run: |
Expand Down

0 comments on commit 70df6bb

Please sign in to comment.