Closed ralbuh closed 1 year ago
The default MD template is tested in every build. Are you sure there's an error even with the MD template from this repo? Are you on the latest version? Please make sure you are, because on Java 17, you need some fairly recent version... see the version matrix in the README page.
Yeah versions are correct afaik.
I just generated a dummy project from spring initializr and added minimal setup and one dummy test. Here you can see the same error. https://github.com/ralbuh/spock-report-issue-254
If you run a mvn clean install
on that demo project you can see the same error message
The MD template seems to have a bug:
if ( feature.attachments.size > 0 )
On line 32 for me... Can you change that to this:
if ( feature.attachments.size() > 0 )
And try again?
Yeah that solved it. Very nice, thanks for you help again and you quick reply!
I will keep this open as I'll have to release a fix. There's another bug I wanted to fix as well so it's time for a release anyway. Glad it works for you.
This line has been the same since 2016. There seems to be tests that check this. I just don't understand how this could break now, or how it was actually working?!
The code is printing "See: " if that condition is true:
if ( feature.attachments.size > 0 ) {
out << '\n#### ' << 'See:' << '\n\n'
There's a test that checks this: https://github.com/renatoathaydes/spock-reports/blob/master/src/test/resources/FakeTest.md (look for "See:")
So, this is actually working on my tests :D.
My guess is that you used a specific version of Groovy that made size
stop working! Can you check which version you had running @ralbuh ?
This fix is now released on versions 2.5.1-groovy-3.0
and 2.5.1-groovy-4.0
.
We are using customized templates (actually an adoc conversion of provided md templates from this repo) for a while. Recently we upgraded to java 17 and newest springboot and the report generation started failing with the stated error.
We tried converting back to the included md templates in this repo (https://github.com/renatoathaydes/spock-reports/blob/master/src/main/resources/templateReportCreator/spec-template.md & https://github.com/renatoathaydes/spock-reports/blob/master/src/main/resources/templateReportCreator/summary-template.md) but same error there.
Our config:
Error: