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

[bug fix] Fixed tests in test_api.py #1352

Merged
merged 2 commits into from
Jan 18, 2024
Merged

[bug fix] Fixed tests in test_api.py #1352

merged 2 commits into from
Jan 18, 2024

Conversation

linglp
Copy link
Contributor

@linglp linglp commented Jan 18, 2024

There are two tests failing in test_api:

  1. test_get_dataset_files when full_path = False, file_names = None
    The test failed because we changed the walk function in schematic. Since we changed the walk function to only include files and folders, tables are no longer in the output. I updated the tests to make sure that they now pass

  2. test_visualize_component
    "Component" should be required, so I updated the False to True

Note: i found out this issue when doing a release of schematic v24.1.1
Related to: https://sagebionetworks.jira.com/browse/FDS-1604

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

Copy link
Contributor

@mialy-defelice mialy-defelice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works, see below:

(schematicpy-py3.9) sh-3.2# pytest tests/test_api.py::TestSynapseStorage::test_get_dataset_files[None-False]
========================== test session starts ===========================
platform darwin -- Python 3.9.16, pytest-7.4.3, pluggy-1.3.0 -- /Users/mialydefelice/Library/Caches/pypoetry/virtualenvs/schematicpy-rs9bwhSl-py3.9/bin/python
cachedir: .pytest_cache
rootdir: /Users/mialydefelice/Documents/schematic_e/schematic
configfile: pyproject.toml
plugins: rerunfailures-12.0, cov-4.1.0, anyio-4.1.0, mock-3.12.0, xdist-3.5.0
collected 1 item                                                         

tests/test_api.py::TestSynapseStorage::test_get_dataset_files[None-False] PASSED [100%]

===================== 1 passed in 125.64s (0:02:05) ======================
(schematicpy-py3.9) sh-3.2# pytest tests/test_api.py::TestSchemaVisualization::test_visualize_component
========================== test session starts ===========================
platform darwin -- Python 3.9.16, pytest-7.4.3, pluggy-1.3.0 -- /Users/mialydefelice/Library/Caches/pypoetry/virtualenvs/schematicpy-rs9bwhSl-py3.9/bin/python
cachedir: .pytest_cache
rootdir: /Users/mialydefelice/Documents/schematic_e/schematic
configfile: pyproject.toml
plugins: rerunfailures-12.0, cov-4.1.0, anyio-4.1.0, mock-3.12.0, xdist-3.5.0
collected 2 items                                                        

tests/test_api.py::TestSchemaVisualization::test_visualize_component[Patient-Component,Component,TBD,True,,,,Patient] PASSED [ 50%]
tests/test_api.py::TestSchemaVisualization::test_visualize_component[BulkRNA-seqAssay-Component,Component,TBD,True,,,,BulkRNA-seqAssay] PASSED [100%]

=========================== 2 passed in 3.80s ============================
(schematicpy-py3.9) sh-3.2# 

@linglp linglp merged commit 30b3177 into develop Jan 18, 2024
3 of 4 checks passed
@linglp linglp deleted the develop-fix-test branch January 18, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants