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

Spock fixture methods not being called when ran with @RunWith(ArquillianSputnik) #35

Closed
johnmc5810 opened this issue Jul 31, 2018 · 6 comments

Comments

@johnmc5810
Copy link

Issue Overview

The fixture methods are not being called when ran with @RunWith(ArquillianSputnik)

Expected Behaviour

The fixture methods are called as in other spock tests

Current Behaviour

Fixture methods not being called

Steps To Reproduce
  1. Create a simple test case, e.g. get google.com, assert on page title
  2. Add fixture methods
    def setup() { println("-------setup------------------") } // run before every feature method
    def cleanup() { println("-------cleanup------------------") } // run after every feature method
    def setupSpec() { println("-------setupSpec------------------") } // run before the first feature method
    def cleanupSpec() { println("-------cleanupSpec------------------") } // run after the last feature method
Additional Information

Using JDK 8

@kriegaex
Copy link
Contributor

Which versions of Groovy, Spock and Arquillian-Spock did you use?

@johnmc5810
Copy link
Author

Hi, thanks for getting back to me.

groovy: 2.4.8
spock: 0.7-groovy-2.0
arquillian-spock: 1.0.0

@kriegaex
Copy link
Contributor

kriegaex commented Nov 14, 2018

As you have not provided a complete MCVE, i.e. a Maven POM and a full test case reproducing your problem, I can just speculate about the root cause of your problem. But assuming your build setup and Spock specificattion are both okay, I can say this:

You are using an old Spock version targeted at Groovy 2.0, maybe this is part of the problem. As you can see on Maven Central, Groovy 2.4 versions are available as of Spock 1.0 (current is 1.2).

Not being a maintainer, only a user, I also know that the Arquillian runner does not work perfectly with Spock 1.x, see #18, but also #21 and #26. Still, it might be worth a try to build a snapshot version of the Spock 1.0 branch and use a more recent Spock version. This does not work perfectly, but mostly okay.

@kriegaex
Copy link
Contributor

I just saw this again today and was wondering if you could solve your problem back then. Just not providing feedback is not a good way to close open tickets and definitely not a nice way to treat persons who try to help you.

@kriegaex
Copy link
Contributor

Please don't just close the ticket, please return some information to the community you asked for help. What did you do to solve the problem?

@johnmc5810
Copy link
Author

I changed company so issue was never solved. To recreate,you just use same dependencies and see if hooks are being called. I don't have access to the original project. It's Sunday man,chill out 😁

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