Conversation
0f67bd0 to
e744d79
Compare
Codecov Report
@@ Coverage Diff @@
## master #522 +/- ##
=======================================
Coverage 85.63% 85.63%
=======================================
Files 40 40
Lines 1893 1893
=======================================
Hits 1621 1621
Misses 272 272 Continue to review full report at Codecov.
|
test/integration/dss/test_dss_cli.py
Outdated
| args = ["dss", "get-bundles-all", "--replica", "aws", | ||
| "--per-page", "10", "--no-paginate"] | ||
| with CapturingIO('stdout') as stdout: | ||
| hca.cli.main(args) | ||
| result = json.loads(stdout.captured()) | ||
| try: | ||
| assert("https://dss.data.humancellatlas.org" not in result["dss_api"]) | ||
| except AssertionError: | ||
| print('\nPlease change the DSS swagger endpoint in the HCA config file away from `dss-prod`\n' | ||
| 'For more information see: `https://github.com/HumanCellAtlas/dcp-cli#development`') | ||
| exit(1) |
There was a problem hiding this comment.
Couldn't you also do this by inspecting / importing the DSS config? Then you could check the stage without needing to make an API call.
Also I think this is a round-about use of assert. A conditional would be more concise and clear.
Calling exit here seems like overkill. If only these tests use the outside resource, then there's no need to quit the whole process; other tests should be allowed to run. If other tests (not in TestDssCLI) are counting on this fail mechanism then I'd say that's a problem. Unittest doesn't guarantee the order or test evaluation.
Since you don't need to call exit(), then I think it's sufficient just to raise ValueError() here. This would allow other tests (if they exist) to still run.
There was a problem hiding this comment.
Fair points, I've incorporated them all. :)
jessebrennan
left a comment
There was a problem hiding this comment.
If you decide to squash these, check out git rebase -i --autosuash.
|
If the association to the connected issue isn't clear: this PR prevents the creation of more bad bundles by DSS tests. And it's the goal of #1768 to remove those bundles. |
Removes the potential for dss-tests to be run against
dss-prodwhen on an operators machine.See: DataBiosphere/azul#1768