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

chore: add tests for the run engine #251

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

a-kenji
Copy link
Contributor

@a-kenji a-kenji commented Sep 25, 2023

Add tests for the run engine. A particular focus of these tests are
allowing assertions of the relationships between:

  • configuration
  • directory structure
  • walked files
  • matched files

What has been done:

  • refactored parts of the run function into it's own methods
  • tested these methods
  • goal is a pure refactor and no behavioral changes

cargo tarpaulin:

src/engine.rs: 69/200 +34.50%
src/formatter.rs: 36/74 +48.65%

Extract certain methods from the `run` function of the engine,
in order to make testing feasible.
Add a Statistics struct, carrying timing debug information and unifying
collection of metrics, simplifying testing and printing of summaries.
Add tests for the run engine. The particular focus of these tests are
allowing assertions of the relationships between configuration,
directory structure, walked files and matched files.
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

this is great, thank you

@zimbatm zimbatm merged commit e1ca0bc into numtide:main Sep 28, 2023
11 checks passed
@a-kenji a-kenji deleted the improve/test-coverage branch September 28, 2023 11:58
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