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

Use annotations to mark test Specs and/or features as @RegTest or not. #6

Open
msgilligan opened this issue Sep 14, 2015 · 5 comments

Comments

@msgilligan
Copy link
Member

Using annotations and an external Spock configuration file, we should be able to mark test Specs or feature tests as requiring RegTest mode or not.

A test that has a @RegTest annotation would only run if the current functional/integration test configuration was running against a server in RegTest mode.

See Spocklight: Including or Excluding Specifications Based On Annotations by @mrhaki.

So for example, the entire class BitcoinStepwiseSpec would have a @RegTest annotation. Whereas, BitcoinSpec would only user @RegTest on feature test methods that used generateBlock().

@msgilligan
Copy link
Member Author

@dexX7 Obviously this would be useful for Omni testing, as well.

@dexX7
Copy link
Member

dexX7 commented Sep 14, 2015

This is very nice! Potentially, this could also be used to get rid of the setupSpec -> !commandExists -> throw AssumptionViolatedException workarounds?

@msgilligan
Copy link
Member Author

Well, there's another @mrhaki Spocklight article that may have a better solution for that case: Spocklight: Only Run Specs Based On Conditions.

@dexX7
Copy link
Member

dexX7 commented Sep 21, 2015

At least out of the box it's not as simple as adding:

@Requires({ commandExists('abc') })

While it works with simple expressions such as { true }, I assume this is because I'm trying to access the RPC client.

@mrhaki
Copy link

mrhaki commented Sep 21, 2015

If the method commandExists is a static method it should work in they way you described it.

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

No branches or pull requests

3 participants