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

Can't set source directory #255

Open
rjclancy opened this issue Oct 19, 2023 · 6 comments
Open

Can't set source directory #255

rjclancy opened this issue Oct 19, 2023 · 6 comments

Comments

@rjclancy
Copy link

I'm trying to target a specific test directory i.e sec/main/groovy/.../integration that I would like to generate my reports but overriding this in my build gradle doesn't work

test System Property: com.athaydes.spockframework.report.testSourceRoots=src/test/groovy

Is this the correct approach?

@renatoathaydes
Copy link
Owner

Yes, that should work... if not, can you try the SpockConfig.groovy file as shown here?

@renatoathaydes
Copy link
Owner

Notice that this property is only used to include the source code in the reports:

# Set the root location of the Spock test source code (only used if showCodeBlocks is 'true')
com.athaydes.spockframework.report.testSourceRoots=src/test/groovy

Is this your problem? Or are you trying to get Spock to find your actual tests? If that's the case, then you need to change your groovy config.

@rjclancy
Copy link
Author

rjclancy commented Oct 25, 2023

Thanks @renatoathaydes. Yup, I just want to generate reports for tests within my src/test/groovy/integration dir exclude everything else in src/test/groovy..

@renatoathaydes
Copy link
Owner

So, tests are executed but no reports are generated?

@rjclancy
Copy link
Author

So, tests are executed but no reports are generated?

All my tests are executed. I just would like to generate the Spock report for a specific directory.

src/main/groovy/service: don't care

src/main/groovy/integration: do care

@renatoathaydes
Copy link
Owner

spock-reports is called by Spock for each test that runs, there's no way to exclude tests from reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants