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

test: add rstest and fixtures #632

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

test: add rstest and fixtures #632

wants to merge 5 commits into from

Conversation

carlosvdr
Copy link
Collaborator

@carlosvdr carlosvdr commented Feb 14, 2025

Added rstest:

  • with this several tests have been refactored to only receive fixtures created on rstest

this PR aims to make the tests more easy reading and only focusing on the important bits per test

Due to the nature of async fixtures some tests could use them since the test itself needed to be in some order for it to work as intended.

@carlosvdr carlosvdr self-assigned this Feb 14, 2025
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Pull Request Test Coverage Report for Build 13816278472

Details

  • 55 of 59 (93.22%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 75.779%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/tap-agent/src/agent/sender_accounts_manager.rs 7 9 77.78%
crates/test-assets/src/lib.rs 29 31 93.55%
Totals Coverage Status
Change from base Build 13802845213: -0.2%
Covered Lines: 8322
Relevant Lines: 10982

💛 - Coveralls

@carlosvdr carlosvdr marked this pull request as ready for review February 14, 2025 22:53
test: revert test

fix: tests that fixtures werent available

fix: add tokyo to tests

style: run cargo clippy
Copy link
Collaborator

@TypeLevelConsoli TypeLevelConsoli left a comment

Choose a reason for hiding this comment

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

fixtures indeed made the code clearer, thanks for this

@@ -74,6 +74,7 @@ tokio-test = "0.4.4"
wiremock.workspace = true
insta = "1.41.1"
test-log.workspace = true
async-std = { version = "1.12.0", features = ["attributes"] }

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think async-std is necessary, we're using #[tokio::test] on every async test case (same thing for tap-agent)

Copy link
Collaborator

@neithanmo neithanmo left a comment

Choose a reason for hiding this comment

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

Looks good to me

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.

4 participants