Skip to content

Commit 462e447

Browse files
committed
Merge branch 'feat/DEVSU-2616-create-project-when-submitting-a-report-with-report_async' of github.com:bcgsc/pori_python into feat/DEVSU-2616-create-project-when-submitting-a-report-with-report_async
2 parents 9ba8254 + 813977c commit 462e447

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Note that IPR tests will try to use the BCGSC production GraphKB API by default.
5151
If you want to test interaction with a different instance, you will need to
5252
set the GraphKB variables.
5353

54-
Set EXCLUDE vars to 1 if you don't want to run these tests.
54+
Set EXCLUDE vars to 1 if you don't want to run these tests.
5555
ONCOKB and BCGSC tests are enabled by default.
5656

5757
```bash
@@ -61,17 +61,21 @@ export IPR_URL='http://localhost:8081/api'
6161
export GRAPHKB_USER='pori_admin'
6262
export GRAPHKB_PASS='pori_admin'
6363
export GRAPHKB_URL='http://localhost:8080/api'
64-
EXCLUDE_BCGSC_TESTS = 1
65-
EXCLUDE_ONCOKB_TESTS = 1
64+
export EXCLUDE_BCGSC_TESTS=1
65+
export EXCLUDE_ONCOKB_TESTS=1
6666
```
6767

6868
If you want to run tests that upload reports to a live IPR instance,
6969
specify the url of the IPR API you want to use and set the test var to 1.
7070
These tests are disabled by default.
7171

72+
The created reports are deleted by default. If you want to keep them,
73+
set DELETE_UPLOAD_TEST_REPORTS to 0 in the env.
74+
7275
```bash
7376
export IPR_TEST_URL='http://localhost:8081/api'
74-
INCLUDE_UPLOAD_TESTS = 1
77+
export INCLUDE_UPLOAD_TESTS=1
78+
export DELETE_UPLOAD_TEST_REPORTS=0
7579
```
7680

7781
```bash

tests/test_ipr/test_upload.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
EXCLUDE_BCGSC_TESTS = os.environ.get("EXCLUDE_BCGSC_TESTS") == "1"
1717
EXCLUDE_ONCOKB_TESTS = os.environ.get("EXCLUDE_ONCOKB_TESTS") == "1"
18-
INCLUDE_UPLOAD_TESTS = os.environ.get("INCLUDE_UPLOAD_TESTS", 0) == "1"
18+
INCLUDE_UPLOAD_TESTS = os.environ.get("INCLUDE_UPLOAD_TESTS", "0") == "1"
19+
DELETE_UPLOAD_TEST_REPORTS = os.environ.get("DELETE_UPLOAD_TEST_REPORTS", "1") == "1"
1920

2021

2122
def get_test_spec():
@@ -154,9 +155,9 @@ def loaded_reports(tmp_path_factory) -> Generator:
154155
"async": (async_patient_id, async_loaded_report),
155156
}
156157
yield loaded_reports_result
157-
return
158-
ipr_conn.delete(uri=f"reports/{loaded_report['reports'][0]['ident']}")
159-
ipr_conn.delete(uri=f"reports/{async_loaded_report['reports'][0]['ident']}")
158+
if DELETE_UPLOAD_TEST_REPORTS:
159+
ipr_conn.delete(uri=f"reports/{loaded_report['reports'][0]['ident']}")
160+
ipr_conn.delete(uri=f"reports/{async_loaded_report['reports'][0]['ident']}")
160161

161162

162163
def get_section(loaded_report, section_name):

0 commit comments

Comments
 (0)