Skip to content

Commit

Permalink
Add git workflow to test study import export
Browse files Browse the repository at this point in the history
  • Loading branch information
forus committed Dec 19, 2024
1 parent 1ec3771 commit 1943540
Show file tree
Hide file tree
Showing 8 changed files with 614 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
working-directory: ./cbioportal-docker-compose
run: |
$PORTAL_SOURCE_DIR/test/integration/test_load_study.sh
- name: 'TEST - Import and Export of study_es_0_import_export'
if: steps.startup.conclusion == 'success'
working-directory: ./cbioportal-docker-compose
run: |
$PORTAL_SOURCE_DIR/test/integration/test_import_export.sh
- name: 'TEST - Add OncoKB annotations to study'
if: steps.startup.conclusion == 'success'
working-directory: ./cbioportal-docker-compose
Expand Down
25 changes: 25 additions & 0 deletions test/integration/test_import_export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# exit when any of these fails
set -e

run_in_service() {
service=$1
shift
docker-compose -f docker-compose.yml -f $PORTAL_SOURCE_DIR/test/integration/docker-compose-localbuild.yml \
run --rm \
"$service" bash -c "$@"
return $? # return the exit code of the last command
}

echo "Importing of the test study with API validation..."
run_in_service cbioportal 'metaImport.py -v -u http://cbioportal-container:8080 -o -s /cbioportal/test/test_data/study_es_0_import_export/'

echo "Exporting of the test study."
run_in_service cbioportal 'curl -s http://cbioportal-container:8080/export/study/study_es_0_import_export.zip | unzip -d ./output_study_es_0_import_export -'

echo "Comparing the original and exported studies."
# TODO ignore order of lines in files
run_in_service cbioportal 'diff --recursive /cbioportal/test/test_data/study_es_0_import_export/ ./output_study_es_0_import_export'

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cancer_study_identifier: study_es_0_import_export
stable_id: study_es_0_import_export_sequenced
case_list_name: Samples profiled for mutations
case_list_description: This is this case list that contains all samples that are profiled for mutations.
case_list_ids: TCGA-A2-A04P-01 TCGA-A1-A0SK-01 TCGA-A2-A0CM-01 TCGA-AR-A1AR-01 TCGA-B6-A0WX-01 TCGA-BH-A1F0-01 TCGA-B6-A0I6-01 TCGA-BH-A18V-01 TCGA-BH-A18K-01 TCGA-BH-A0HL-01 TCGA-BH-A0E0-01 TCGA-A1-A0SB-01 TCGA-A1-A0SB-02 TEST_SAMPLE_1 TEST_SAMPLE_2 TEST_SAMPLE_3 TEST_SAMPLE_4 TEST_SAMPLE_15 TEST_SAMPLE_SOMATIC_HOMOZYGOUS TEST_SAMPLE_SOMATIC_HETEROZYGOUS TEST_SAMPLE_SOMATIC_UNDEFINED
Loading

0 comments on commit 1943540

Please sign in to comment.