-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
41 additions
and
3,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
SHELL := /bin/bash | ||
|
||
export BACKEND_DIR=/tmp/cryoet-data-portal-backend-test-infra | ||
.PHONY: set-api-version | ||
set-api-version: | ||
if [ ! -e $(BACKEND_DIR) ]; then git clone [email protected]:chanzuckerberg/cryoet-data-portal-backend.git $(BACKEND_DIR); fi | ||
export STAGING_SHA=$$(python3 tests/test_infra/get_deployment.sh staging); \ | ||
if [ -z $STAGING_SHA ]; then \ | ||
echo "Setting backend to SHA: $${STAGING_SHA}"; \ | ||
cd $(BACKEND_DIR); \ | ||
git fetch; \ | ||
git reset --hard $$STAGING_SHA; \ | ||
else \ | ||
echo "Could not get staging SHA!"; \ | ||
exit 1; \ | ||
fi | ||
cd $(BACKEND_DIR) && make apiv2-init | ||
|
||
.PHONY: test-infra | ||
test-infra: | ||
# Use force-recreate to handle re-initializing the database schema and data | ||
# rather than maintaining incremental migrations. | ||
# See the test_infra/hasura/README.md for more details. | ||
cd tests && docker compose up -d --wait --wait-timeout 300 --force-recreate | ||
test-infra: set-api-version | ||
cp tests/test_infra/seed_db.py $(BACKEND_DIR)/apiv2/scripts | ||
cd $(BACKEND_DIR) && docker compose run graphql-api python3 scripts/seed_db.py | ||
cd ./tests/test_infra/; ./seed_moto.sh | ||
|
||
.PHONY: clean | ||
clean: | ||
if [ -e $(BACKEND_DIR) ]; then cd $(BACKEND_DIR); make clean; fi | ||
rm -rf $(BACKEND_DIR) | ||
|
||
.PHONY: coverage | ||
coverage: | ||
export AWS_REGION=us-west-2; \ | ||
|
10 changes: 10 additions & 0 deletions
10
client/python/cryoet_data_portal/tests/test_infra/get_deployment.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if [ $1 == 'staging' ]; then | ||
# If there's a release-please branch, this is the file that controls staging versions! | ||
RELEASE_SHA=$(curl -s "https://raw.githubusercontent.com/chanzuckerberg/cryoet-data-portal-backend/refs/heads/release-please--branches--main--components--apiv2/.infra/staging/values.yaml" | grep ' tag:' | head -n 1 | awk '{ print $2; }' | cut -d '-' -f 2) | ||
fi | ||
if [ -n "$RELEASE_SHA" ]; then | ||
echo $RELEASE_SHA | ||
else | ||
# If this isn't staging, or we don't have an active release-please branch, fetch the appropriate hash from the `main` branch. | ||
curl -s "https://raw.githubusercontent.com/chanzuckerberg/cryoet-data-portal-backend/refs/heads/main/.infra/$1/values.yaml" | grep ' tag:' | head -n 1 | awk '{ print $2; }' | cut -d '-' -f 2 | ||
fi |
35 changes: 0 additions & 35 deletions
35
client/python/cryoet_data_portal/tests/test_infra/hasura/README.md
This file was deleted.
Oops, something went wrong.
Empty file removed
0
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/actions.graphql
Empty file.
6 changes: 0 additions & 6 deletions
6
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/actions.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/allow_list.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/api_limits.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/backend_configs.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/python/cryoet_data_portal/tests/test_infra/hasura/metadata/cron_triggers.yaml
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
...st_infra/hasura/metadata/databases/cryoetdataportal/tables/public_annotation_authors.yaml
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...test_infra/hasura/metadata/databases/cryoetdataportal/tables/public_annotation_files.yaml
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
...ests/test_infra/hasura/metadata/databases/cryoetdataportal/tables/public_annotations.yaml
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
.../test_infra/hasura/metadata/databases/cryoetdataportal/tables/public_dataset_authors.yaml
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
.../test_infra/hasura/metadata/databases/cryoetdataportal/tables/public_dataset_funding.yaml
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
...l/tests/test_infra/hasura/metadata/databases/cryoetdataportal/tables/public_datasets.yaml
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
...st_infra/hasura/metadata/databases/cryoetdataportal/tables/public_deposition_authors.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.