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

Build out the custom extension tests #974

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Feb 1, 2023

Related Issue(s):

Description:

After further inspection, the only real test file that wasn't really being exercised was extensions/test_custom.py. This PR builds out some extension tests, and removes some sections that were mostly just testing tests (aka not useful tests for the main codebase).

IMO this is Good Enough™ coverage in the test suite, most of the missed lines are conditionals in mocks:

---------- coverage: platform darwin, python 3.10.6-final-0 ----------
Name                                      Stmts   Miss Branch BrPart  Cover
---------------------------------------------------------------------------
tests/__init__.py                            12      0      2      0   100%
tests/extensions/__init__.py                  0      0      0      0   100%
tests/extensions/test_custom.py             131      0     20      4    97%
tests/extensions/test_datacube.py            64      0      6      0   100%
tests/extensions/test_eo.py                 192      0     16      0   100%
tests/extensions/test_file.py               146      0      8      0   100%
tests/extensions/test_grid.py                73      0     14      0   100%
tests/extensions/test_item_assets.py         51      0      0      0   100%
tests/extensions/test_label.py              323      0     48      4    99%
tests/extensions/test_pointcloud.py         228      0     36      0   100%
tests/extensions/test_projection.py         246      0     16      0   100%
tests/extensions/test_raster.py             129      0     12      0   100%
tests/extensions/test_sar.py                217      0      6      0   100%
tests/extensions/test_sat.py                197      0      8      0   100%
tests/extensions/test_scientific.py         328      0     12      0   100%
tests/extensions/test_storage.py            175      0     30      0   100%
tests/extensions/test_table.py               35      0      4      0   100%
tests/extensions/test_timestamps.py         160      0     14      0   100%
tests/extensions/test_version.py            340      0      8      0   100%
tests/extensions/test_view.py               198      0      6      0   100%
tests/html/__init__.py                        0      0      0      0   100%
tests/html/test_html.py                      23      0      0      0   100%
tests/serialization/__init__.py               0      0      0      0   100%
tests/serialization/test_identify.py         62      0      6      0   100%
tests/serialization/test_migrate.py          48      0      6      0   100%
tests/test_cache.py                          52      0      4      0   100%
tests/test_catalog.py                       861      1    280      1    99%
tests/test_collection.py                    274      0     32      1    99%
tests/test_common_metadata.py               340      0     10      0   100%
tests/test_item.py                          249      0     48      1    99%
tests/test_item_collection.py               104      0     22      0   100%
tests/test_layout.py                        265      0      8      0   100%
tests/test_link.py                          184      0     10      0   100%
tests/test_stac_io.py                        70      0     16      0   100%
tests/test_summaries.py                      71      0      4      0   100%
tests/test_utils.py                         111      2     42      3    97%
tests/test_version.py                        20      0      2      0   100%
tests/test_writing.py                        70      0     28      0   100%
tests/utils/__init__.py                      27      0     14      1    98%
tests/utils/stac_io_mock.py                  27      1      4      1    94%
tests/utils/test_cases.py                    77      0      8      0   100%
tests/validation/__init__.py                  0      0      0      0   100%
tests/validation/test_schema_uri_map.py       8      0      0      0   100%
tests/validation/test_validate.py            78      0     22      0   100%
---------------------------------------------------------------------------
TOTAL                                      6266      4    832     16    99%

Required test coverage of 90.0% reached. Total coverage: 99.72%

PR Checklist:

  • Code is formatted (run pre-commit run --all-files)
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@gadomski gadomski self-assigned this Feb 1, 2023
@gadomski gadomski added this to the 1.7 milestone Feb 1, 2023
@gadomski gadomski force-pushed the issues/951-non-running-test-lines branch from 6ae6d0b to 18223d0 Compare February 1, 2023 17:51
@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Base: 90.09% // Head: 90.09% // No change to project coverage 👍

Coverage data is based on head (801e096) compared to base (b393b0d).
Patch has no changes to coverable lines.

❗ Current head 801e096 differs from pull request most recent head c584201. Consider uploading reports for the commit c584201 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #974   +/-   ##
=======================================
  Coverage   90.09%   90.09%           
=======================================
  Files          47       47           
  Lines        6090     6090           
  Branches      915      915           
=======================================
  Hits         5487     5487           
  Misses        422      422           
  Partials      181      181           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

tests/extensions/test_custom.py Outdated Show resolved Hide resolved
tests/extensions/test_custom.py Show resolved Hide resolved
tests/extensions/test_custom.py Show resolved Hide resolved
@pjhartzell
Copy link
Collaborator

99% coverage! Probably should bump up the fail_under threshold in the .coveragerc file from the current 90% to ... 99%?

@gadomski gadomski force-pushed the issues/951-non-running-test-lines branch from 801e096 to c584201 Compare February 2, 2023 14:54
@gadomski
Copy link
Member Author

gadomski commented Feb 2, 2023

99% coverage! Probably should bump up the fail_under threshold in the .coveragerc file from the current 90% to ... 99%?

99% only for the tests :-) ... base coverage is still 91%. Also ironic that increasing the test coverage doesn't increase project coverage, which makes me wonder what we're even doing here. Ah well, hopefully this will all get reworked as a part of #448 anyways.

@pjhartzell
Copy link
Collaborator

Ah. Oops. Yeah.

@gadomski gadomski enabled auto-merge (rebase) February 2, 2023 16:09
@gadomski gadomski merged commit 12863c1 into main Feb 2, 2023
@gadomski gadomski deleted the issues/951-non-running-test-lines branch February 2, 2023 16:14
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.

Fix non-running test lines
3 participants