arquillian / arquillian-testrunner-spock

Arquillian Spock TestRunner
Apache License 2.0
30 stars 20 forks source link

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

Closed johnmc5810 closed 4 years ago

johnmc5810 commented 6 years ago
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 commented 5 years ago

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

johnmc5810 commented 5 years ago

Hi, thanks for getting back to me.

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

kriegaex commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 😁