-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add basic reporting to the test runner #624
Conversation
fbc5f2b
to
4cc8c64
Compare
TestRunner
99b8868
to
4c0eccf
Compare
4c0eccf
to
0a8ab25
Compare
087efff
to
ef9bb0b
Compare
late TestRunnerResult result; | ||
unawaited(() async { | ||
result = await testRunner.run(); | ||
}()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other tests below use regular await
s to get the results – much better since you won't run into the risk of the log output not catching up with the intermediate delays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doing it this way because of https://github.com/dart-lang/fake_async/issues/51. If you know a solution to this ("How to await
function inside of fakeAsync()
), then I'd be happy if you shared it.
BTW the delays are entirely controlled by the fake async, so if the log output "won't catch up", then it's a bug and it's good that tests will fail in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like expectLater won't work the way you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it doesn't. See this commit where I tried this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have an idea how to make this work, I'll be happy to hear it.
targetRunResults.add( | ||
TargetRunResult(target: target, device: device, runs: targetRuns), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's probably not that much of an issue here, but having TargetRunResult
as an Equatable
and then mutating its fields seems like a risky maneuver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I don't think it breaks Equatable
's contract.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok. Besides the fact that i do not like mutability at all, but whether it is Equatable or not doesn't change anything here.
targetRunResults.add( | ||
TargetRunResult(target: target, device: device, runs: targetRuns), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok. Besides the fact that i do not like mutability at all, but whether it is Equatable or not doesn't change anything here.
late TestRunnerResult result; | ||
unawaited(() async { | ||
result = await testRunner.run(); | ||
}()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like expectLater won't work the way you want?
Fixes #598
Also mostly fixes _ #561, but #561 is a bit broader, so I'm not closing #561