Skip to content

Commit

Permalink
Revert config to defaults (#1539)
Browse files Browse the repository at this point in the history
* revert config files back
  • Loading branch information
andrewelamb authored Nov 12, 2024
1 parent 16b6617 commit 625a9a8
Show file tree
Hide file tree
Showing 8 changed files with 443 additions and 313 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }}
run: >
poetry run pytest --durations=0 --cov-append --cov-report=term --cov-report=html:htmlcov --cov-report=xml:coverage.xml --cov=schematic/
-m "not (rule_benchmark or single_process_execution or slow_test)" --reruns 4 -n 8 --ignore=tests/unit
-m "not (rule_benchmark or single_process_execution)" --reruns 4 -n 8 --ignore=tests/unit
- name: Run integration tests single process
if: ${{ contains(fromJSON('["3.10"]'), matrix.python-version) }}
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
python_files = test_*.py
asyncio_mode = auto
asyncio_default_fixture_loop_scope = session
log_cli = True
log_cli = False
log_cli_level = INFO
markers =
google_credentials_needed: marks tests requiring Google credentials (skipped on GitHub CI)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Sample ID,Patient ID,Tissue Status,Component
1,1,Healthy,Biospecimen
1,1,Healthy,Biospecimen
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Filename,Sample ID,File Format,Component,Genome Build,Genome FASTA,entityId
Manifest Submission - Manual test - file-based manifest submission/test-dataset/sample A.txt,1,FASTQ,BulkRNA-seqAssay,,,syn63561932
Manifest Submission - Manual test - file-based manifest submission/test-dataset/sample A.txt,1,FASTQ,BulkRNA-seqAssay,,,syn63561932
96 changes: 56 additions & 40 deletions tests/integration/test_manifest_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from openpyxl import load_workbook

from tests.conftest import ConfigurationForTesting
from schematic.configuration.configuration import CONFIG

LIGHT_BLUE = "FFEAF7F9" # Required cell
GRAY = "FFE0E0E0" # Header cell
Expand Down Expand Up @@ -280,26 +281,33 @@ def test_single_manifest_generation_google_sheet_with_annotations(
- When File Format = "FASTQ", [Genome Build] is White (Optional)
"""
# GIVEN a valid example manifest to generate
url = f"{testing_config.schematic_api_server_url}/v1/manifest/generate"
params = {
"schema_url": "https://raw.githubusercontent.com/Sage-Bionetworks/schematic/develop/tests/data/example.model.jsonld",
"title": "Example",
"data_type": "BulkRNA-seqAssay",
"use_annotations": "true",
"dataset_id": "syn63561056",
"asset_view": "syn63561086",
"output_format": "google_sheet",
"strict_validation": "true",
"data_model_labels": "class_label",
}
headers = {"accept": "application/json", "Authorization": f"Bearer {syn_token}"}

# WHEN we make a request to the Schematic API
response = (
requests.get(url, headers=headers, params=params, timeout=300)
if testing_config.use_deployed_schematic_api_server
else flask_client.get(url, query_string=params, headers=headers)
)
try:
url = f"{testing_config.schematic_api_server_url}/v1/manifest/generate"
params = {
"schema_url": "https://raw.githubusercontent.com/Sage-Bionetworks/schematic/develop/tests/data/example.model.jsonld",
"title": "Example",
"data_type": "BulkRNA-seqAssay",
"use_annotations": "true",
"dataset_id": "syn63561056",
"asset_view": "syn63561086",
"output_format": "google_sheet",
"strict_validation": "true",
"data_model_labels": "class_label",
}
headers = {
"accept": "application/json",
"Authorization": f"Bearer {syn_token}",
}
# WHEN we make a request to the Schematic API
response = (
requests.get(url, headers=headers, params=params, timeout=300)
if testing_config.use_deployed_schematic_api_server
else flask_client.get(url, query_string=params, headers=headers)
)
finally:
# Resets the config to its default state
# TODO: remove with https://sagebionetworks.jira.com/browse/SCHEMATIC-202
CONFIG.load_config("config_example.yml")

# THEN we expect a successful response
assert response.status_code == 200
Expand Down Expand Up @@ -558,26 +566,34 @@ def test_single_manifest_generation_google_sheet_no_annotations(
- When File Format = "CRAM", [Genome Build, Genome FASTA] is Light Blue (Required)
- When File Format = "FASTQ", [Genome Build] is White (Optional)
"""
url = f"{testing_config.schematic_api_server_url}/v1/manifest/generate"
# GIVEN a valid request to the Schematic API to generate a Google Sheet manifest without annotations
params = {
"schema_url": "https://raw.githubusercontent.com/Sage-Bionetworks/schematic/develop/tests/data/example.model.jsonld",
"title": "Example",
"data_type": "BulkRNA-seqAssay",
"use_annotations": "false",
"dataset_id": "syn63561056",
"asset_view": "syn63561086",
"output_format": "google_sheet",
"strict_validation": "true",
"data_model_labels": "class_label",
}
headers = {"accept": "application/json", "Authorization": f"Bearer {syn_token}"}
# WHEN we make a request to the Schematic API
response = (
requests.get(url, headers=headers, params=params, timeout=300)
if testing_config.use_deployed_schematic_api_server
else flask_client.get(url, query_string=params, headers=headers)
)
try:
url = f"{testing_config.schematic_api_server_url}/v1/manifest/generate"
# GIVEN a valid request to the Schematic API to generate a Google Sheet manifest without annotations
params = {
"schema_url": "https://raw.githubusercontent.com/Sage-Bionetworks/schematic/develop/tests/data/example.model.jsonld",
"title": "Example",
"data_type": "BulkRNA-seqAssay",
"use_annotations": "false",
"dataset_id": "syn63561056",
"asset_view": "syn63561086",
"output_format": "google_sheet",
"strict_validation": "true",
"data_model_labels": "class_label",
}
headers = {
"accept": "application/json",
"Authorization": f"Bearer {syn_token}",
}
# WHEN we make a request to the Schematic API
response = (
requests.get(url, headers=headers, params=params, timeout=300)
if testing_config.use_deployed_schematic_api_server
else flask_client.get(url, query_string=params, headers=headers)
)
finally:
# Resets the config to its default state
# TODO: remove with https://sagebionetworks.jira.com/browse/SCHEMATIC-202
CONFIG.load_config("config_example.yml")

# THEN we expect a successful response
assert response.status_code == 200
Expand Down
Loading

0 comments on commit 625a9a8

Please sign in to comment.