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

refactor: only use channel to return test results #6550

Merged
merged 9 commits into from
Dec 8, 2023

Conversation

DaniPopes
Copy link
Member

Motivation

Starting to clean up the mess that is test code.

Solution

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

very excited about this!

all those changes lgtm!

/// The same as [`test`](Self::test), but returns the results instead of streaming them.
///
/// Note that returns only when all tests have been executed.
pub async fn test_map(
Copy link
Member

Choose a reason for hiding this comment

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

maybe something like test_collect? or collect_results?

filter: impl TestFilter,
stream_result: Option<Sender<(String, SuiteResult)>>,
filter: &dyn TestFilter,
stream_result: mpsc::Sender<(String, SuiteResult)>,
Copy link
Member

Choose a reason for hiding this comment

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

What I also want to have here (for followups) is dedicated types instead of tuples.

dealing with BtreeMap<String, Suiteresult> is a bit horrible, I think we want a wrapper type so we can add useful helper functions

@DaniPopes DaniPopes merged commit 8033139 into master Dec 8, 2023
20 checks passed
@DaniPopes DaniPopes deleted the dani/test-cleanup branch December 8, 2023 11:46
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