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

"acceptance" tests #305

Merged
merged 20 commits into from
Mar 28, 2023
Merged

"acceptance" tests #305

merged 20 commits into from
Mar 28, 2023

Conversation

bkmartinjr
Copy link
Contributor

@bkmartinjr bkmartinjr commented Mar 28, 2023

Fixes #185

Notes to reviewer:

  • all tests added as pytest functions
  • the "expensive" tests are marked as such, and several require very large host memory to complete
  • added a README with details on running the tests and as a place to record historical runs for comparison

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #305 (941fee8) into main (36bf74f) will increase coverage by 0.08%.
The diff coverage is 94.91%.

❗ Current head 941fee8 differs from pull request most recent head 955eaf4. Consider uploading reports for the commit 955eaf4 to get more accurate results

@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   91.54%   91.63%   +0.08%     
==========================================
  Files          41       43       +2     
  Lines        2260     2318      +58     
==========================================
+ Hits         2069     2124      +55     
- Misses        191      194       +3     
Flag Coverage Δ
unittests 91.63% <94.91%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/python/cell_census/tests/test_acceptance.py 94.23% <94.23%> (ø)
api/python/cell_census/tests/conftest.py 100.00% <100.00%> (ø)
api/python/cell_census/tests/test_open.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bkmartinjr bkmartinjr marked this pull request as ready for review March 28, 2023 17:05
Copy link
Collaborator

@atolopko-czi atolopko-czi left a comment

Choose a reason for hiding this comment

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

Tests look great. Two minor suggestions to consider before merging.

@@ -65,7 +65,8 @@ plugins = "numpy.typing.mypy_plugin"

[tool.pytest.ini_options]
markers = [
"live_corpus: runs on the live Cell Census data corpus",
"live_corpus: runs on the live Cell Census data corpus and small enough to run in CI",
"expensive: too expensive to run regularly or in CI",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍


These tests are periodically run, and are not part of CI due to their overhead.

Please record:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Please record:
When run, please record the results below and commit to git:

@pytest.mark.live_corpus
@pytest.mark.parametrize("organism", ["homo_sapiens", "mus_musculus"])
@pytest.mark.parametrize(
"obs_value_filter", ["tissue=='aorta'", pytest.param("tissue=='brain'", marks=pytest.mark.expensive)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

pytest is great; TIL: param values can add marks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

always pays to RT*M :-)

- date
- host / instance type
- Python & package versions and OS (tip: use tiledbsoma.show_package_versions())
- full output of: `pytest --durations=0 --expensive ./api/python/cell_census/tests/`
Copy link
Collaborator

Choose a reason for hiding this comment

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

also, the cell census release, unless that shows up in the output? motivation is to know what data size tests last passed for. Maybe each test could output relevant sizes on full reads, like obs. Or output len(obs), len(var), X.nnz once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes on recording the version aliased to latest

I'm not sure we want the tests generating a bunch of output unless it is regularly used. I think your census version is the ideal solution.

Copy link
Member

@ebezzi ebezzi left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Contributor

@pablo-gar pablo-gar left a comment

Choose a reason for hiding this comment

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

LGTM

@bkmartinjr bkmartinjr merged commit 31caedb into main Mar 28, 2023
@bkmartinjr bkmartinjr deleted the bkmartinjr/185-acceptance-tests branch March 28, 2023 20:04
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.

Python API 1.0 acceptance tests are in place and can be executed easily.
4 participants