Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert config to defaults #1539

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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