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

ZIO Test: Make Timeout Strategies Test Aspects #1555

Merged
merged 1 commit into from
Sep 4, 2019
Merged

ZIO Test: Make Timeout Strategies Test Aspects #1555

merged 1 commit into from
Sep 4, 2019

Conversation

adamgfraser
Copy link
Contributor

Resolves #1543.

I made TimeoutStrategy.Warn a test aspect and put it in TimeoutVariants.scala that TestAspect.scala extends, since there are a lot of implementation specific details for printing the timeout warnings that I didn't want to clutter up TestAspect with. TimeoutStrategy.Error and TimeoutStrategy.Ignore go away since they are redundant with TestAspect.timeout and TestAspect.identity.

I changed the second parameter in DefaultRunnableSpec to be defaultTestAspects and take a list of test aspects to apply to the spec, with a default parameter of timeoutWarning(60.seconds). So it becomes a little more general if in the future there are other test aspects we want to have as overridable defaults.

We were still figuring out the details of the solution we wanted here so happy to take it in another direction but thought it would be good if we had a starting point.

@ghostdogpr
Copy link
Member

Very nice to be able to pass any aspect rather than just timeout 👍

@ghostdogpr ghostdogpr merged commit e83b74c into zio:master Sep 4, 2019
@adamgfraser adamgfraser deleted the 1543 branch September 7, 2019 11:59
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.

ZIO Test: Replace timeout parameter to runnable spec with aspects
2 participants