Global extensions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Global extensions

Michael Kutz

Hi,

after writing an annotation driven extension, I now wanted to try a global one for block logging. I have something Cucumberish in mind. Just printing each block comment when it gets executed and give it a different color depending on the contained code's execution result (success, fail, not reached).

I found two things:

First: in Spock 1.0 there is already a LogReportExtension but it is disabled by default and I could not get it to work. I could not find any docs about its configuration. Does anyone know how to make it work?

Second: another underdocumented topic: how do I write a global extension? I mean how do I make Spock recognise it? What needs to be in SpockConfig.groovy?

Thanks in advance
Micha

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Global extensions

David Kowis
I'm using it for our functional tests which are driven by spock. If a test fails, I grab the log file and send it to standard out. I didn't have to do anything special, beyond the two classes you see there, Spock picked up the extension because it was on the class path, I believe.

On Thu, Mar 26, 2015 at 5:06 PM, Michael Kutz <[hidden email]> wrote:

Hi,

after writing an annotation driven extension, I now wanted to try a global one for block logging. I have something Cucumberish in mind. Just printing each block comment when it gets executed and give it a different color depending on the contained code's execution result (success, fail, not reached).

I found two things:

First: in Spock 1.0 there is already a LogReportExtension but it is disabled by default and I could not get it to work. I could not find any docs about its configuration. Does anyone know how to make it work?

Second: another underdocumented topic: how do I write a global extension? I mean how do I make Spock recognise it? What needs to be in SpockConfig.groovy?

Thanks in advance
Micha

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Global extensions

Michael Kutz
Hey David,

thanks for the reply. Somhow just having the extension in the class path did not work for me. I'll hopefully be able to have another try during the weekend. At least from your example I can see that it should work.

Kind regards
Micha

David Kowis <[hidden email]> schrieb am Do., 23. Apr. 2015 um 16:20 Uhr:
I'm using it for our functional tests which are driven by spock. If a test fails, I grab the log file and send it to standard out. I didn't have to do anything special, beyond the two classes you see there, Spock picked up the extension because it was on the class path, I believe.

On Thu, Mar 26, 2015 at 5:06 PM, Michael Kutz <[hidden email]> wrote:

Hi,

after writing an annotation driven extension, I now wanted to try a global one for block logging. I have something Cucumberish in mind. Just printing each block comment when it gets executed and give it a different color depending on the contained code's execution result (success, fail, not reached).

I found two things:

First: in Spock 1.0 there is already a LogReportExtension but it is disabled by default and I could not get it to work. I could not find any docs about its configuration. Does anyone know how to make it work?

Second: another underdocumented topic: how do I write a global extension? I mean how do I make Spock recognise it? What needs to be in SpockConfig.groovy?

Thanks in advance
Micha

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Global extensions

Leonard Brünings
Hi Michael,

you also need this file
https://github.com/rackerlabs/repose/blob/master/repose-aggregator/functional-tests/spock-functional-test/src/test/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension

Spock is using this file to locate your implementation
META-INF/services/org.spockframework.runtime.extension.IGlobalExtension

Cheers
Leonard

On Friday, April 24, 2015 at 10:18:35 AM UTC+2, Michael Kutz wrote:
Hey David,

thanks for the reply. Somhow just having the extension in the class path did not work for me. I'll hopefully be able to have another try during the weekend. At least from your example I can see that it should work.

Kind regards
Micha

David Kowis <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">dko...@...> schrieb am Do., 23. Apr. 2015 um 16:20 Uhr:
Perhaps this will help:
<a href="https://github.com/rackerlabs/repose/tree/master/repose-aggregator/functional-tests/spock-functional-test/src/test/groovy/framework/spockExtensions" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Frackerlabs%2Frepose%2Ftree%2Fmaster%2Frepose-aggregator%2Ffunctional-tests%2Fspock-functional-test%2Fsrc%2Ftest%2Fgroovy%2Fframework%2FspockExtensions\46sa\75D\46sntz\0751\46usg\75AFQjCNHhZ-_ntELKZqUQW1lM0MCoE3jpIA';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Frackerlabs%2Frepose%2Ftree%2Fmaster%2Frepose-aggregator%2Ffunctional-tests%2Fspock-functional-test%2Fsrc%2Ftest%2Fgroovy%2Fframework%2FspockExtensions\46sa\75D\46sntz\0751\46usg\75AFQjCNHhZ-_ntELKZqUQW1lM0MCoE3jpIA';return true;">https://github.com/rackerlabs/repose/tree/master/repose-aggregator/functional-tests/spock-functional-test/src/test/groovy/framework/spockExtensions

I'm using it for our functional tests which are driven by spock. If a test fails, I grab the log file and send it to standard out. I didn't have to do anything special, beyond the two classes you see there, Spock picked up the extension because it was on the class path, I believe.

On Thu, Mar 26, 2015 at 5:06 PM, Michael Kutz <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">micha...@...> wrote:

Hi,

after writing an annotation driven extension, I now wanted to try a global one for block logging. I have something Cucumberish in mind. Just printing each block comment when it gets executed and give it a different color depending on the contained code's execution result (success, fail, not reached).

I found two things:

First: in Spock 1.0 there is already a LogReportExtension but it is disabled by default and I could not get it to work. I could not find any docs about its configuration. Does anyone know how to make it work?

Second: another underdocumented topic: how do I write a global extension? I mean how do I make Spock recognise it? What needs to be in SpockConfig.groovy?

Thanks in advance
Micha

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HSTwjO1Zc2cJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Global extensions

David Kowis
OH Man! I forgot about that. Thanks!

On Fri, May 8, 2015 at 2:37 PM, Leonard Brünings <[hidden email]> wrote:
Hi Michael,

you also need this file
https://github.com/rackerlabs/repose/blob/master/repose-aggregator/functional-tests/spock-functional-test/src/test/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension

Spock is using this file to locate your implementation
META-INF/services/org.spockframework.runtime.extension.IGlobalExtension

Cheers
Leonard

On Friday, April 24, 2015 at 10:18:35 AM UTC+2, Michael Kutz wrote:
Hey David,

thanks for the reply. Somhow just having the extension in the class path did not work for me. I'll hopefully be able to have another try during the weekend. At least from your example I can see that it should work.

Kind regards
Micha

David Kowis <[hidden email]> schrieb am Do., 23. Apr. 2015 um 16:20 Uhr:
I'm using it for our functional tests which are driven by spock. If a test fails, I grab the log file and send it to standard out. I didn't have to do anything special, beyond the two classes you see there, Spock picked up the extension because it was on the class path, I believe.

On Thu, Mar 26, 2015 at 5:06 PM, Michael Kutz <[hidden email]> wrote:

Hi,

after writing an annotation driven extension, I now wanted to try a global one for block logging. I have something Cucumberish in mind. Just printing each block comment when it gets executed and give it a different color depending on the contained code's execution result (success, fail, not reached).

I found two things:

First: in Spock 1.0 there is already a LogReportExtension but it is disabled by default and I could not get it to work. I could not find any docs about its configuration. Does anyone know how to make it work?

Second: another underdocumented topic: how do I write a global extension? I mean how do I make Spock recognise it? What needs to be in SpockConfig.groovy?

Thanks in advance
Micha

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...