Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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