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

[suggestion] Option to add custom build information to summary #165

Open
sbglasius opened this issue Nov 23, 2018 · 4 comments
Open

[suggestion] Option to add custom build information to summary #165

sbglasius opened this issue Nov 23, 2018 · 4 comments

Comments

@sbglasius
Copy link

It would be great, if it was possible to implement an interface (say: ISummaryInfo) that would allow me to add custom build information (like information from GebConfig.groovy) to my summary screen.

I invision that I could have a custom class implementing ISummaryInfo and have a configuration option like com.athaydes.spockframework.report.ISummaryInfo=my.package.MySummaryInfo

The summary info could just be:

interface ISummaryInfo {
     Map getSummaryInfo()
}

and in TemplateReportAggregator this could be added:

        engine.createTemplate( template )
                .make( [ data          : allData,
                         'utils'       : Utils,
                         'fmt'         : new StringFormatHelper(),
                         summaryInfo: summaryInfo ?: [:],
                         projectName   : projectName,
                         projectVersion: projectVersion ] )
                .toString()

The setup of the summaryInfo should happen where the configuration is normally loaded, and it should be injected into TemplateReportAggregator

Let me know what you think.

@renatoathaydes
Copy link
Owner

Hi! I am currently on vacation and will not be able to answer in the next 2 weeks.
Sorry about that, but as soon as I get back I will have a look.

Thanks.

@renatoathaydes
Copy link
Owner

renatoathaydes commented Jan 10, 2019

Hi @sbglasius sorry for the delay.

I hope you are familiar with the extension methods spock-reports adds to spock.lang.Specification.
Basically, it lets any sub-class of Specification to add info to a spec report by calling the reportInfo(info) and reportHeader(header) methods.

Would this not be enough for what you are suggesting? Or in your case, the information really needs to go into the summary report? What kind of information exactly are you planning to add?

@sbglasius
Copy link
Author

@renatoathaydes Yes, I actually think (trying to recall) that is what we do. We basically wanted some build information on the report.

@renatoathaydes
Copy link
Owner

Ok, that's a good idea to add to the summary report... I will add something for that.

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