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

Cram-ify "functional" pytests #1183

Merged
merged 13 commits into from
Mar 21, 2023
Merged

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Mar 15, 2023

(Note: the squashed changes are not review-friendly – see individual commit messages for a better experience.)

Description of proposed changes

Convert "functional" pytests that predated/overlooked the adoption of using Cram to write functional tests in this codebase (except for testing relative dates – see 579c7e3).

In terms of the logic being tested, I also removed some duplication and increased coverage in a few places.

Related issue(s)

N/A – this was prompted by work related to #854 where some of these tests are not compatible. Cram-ify-ing fixes that.

Testing

  • Checks pass
  • No change in Codecov report

Checklist

  • Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file. N/A, no functional changes

subsample-priority-values.t replaces two pytests
(test_read_priority_scores_valid_with_spaces_and_tabs,
test_read_priority_scores_valid) and covers a bit more.

subsample-priority-file-error.t replaces two pytests
(test_read_priority_scores_malformed,
test_read_priority_scores_does_not_exist).
These are already covered by tests/functional/filter/cram/filter-query-example.t
Repurpose filter-min-date.t since it didn't check output contents.
The two tests are related, so put them in the same file.
Reorder imports, fix whitespace, and remove the unnecessary class
@victorlin victorlin self-assigned this Mar 15, 2023
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (8b2dfc5) 68.25% compared to head (d7785a3) 68.25%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1183   +/-   ##
=======================================
  Coverage   68.25%   68.25%           
=======================================
  Files          63       63           
  Lines        6772     6772           
  Branches     1659     1659           
=======================================
  Hits         4622     4622           
  Misses       1841     1841           
  Partials      309      309           
Impacted Files Coverage Δ
augur/__version__.py 100.00% <100.00%> (ø)

... and 18 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@victorlin victorlin requested a review from a team March 15, 2023 23:10
Copy link
Member

@tsibley tsibley left a comment

Choose a reason for hiding this comment

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

+1 for this direction!

I should note that I didn't verify the "Cram-ify …" commits were accurate translations of the old tests, but I trust your care there.

tests/filter/test_relative_dates.py Outdated Show resolved Hide resolved
@victorlin victorlin force-pushed the victorlin/update-filter-pytests branch from 579c7e3 to d7785a3 Compare March 21, 2023 18:46
@victorlin victorlin merged commit da786ea into master Mar 21, 2023
@victorlin victorlin deleted the victorlin/update-filter-pytests branch March 21, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants