Document how to separate REST documenting tests from 'real' Junit tests
See original GitHub issueWhen following the http://docs.spring.io/spring-restdocs/docs/1.0.0.M1/reference/html5/#getting-started-build-configuration-gradle setup the documenting tests are in the same ‘scope’ as the normal junit tests.
I think this is a bad practice. When you have a fairly big project with a lot of ‘real’ junit tests it means when generating the docs all junit tests will be run as well. This is time consuming if you just want to work on documentation.
Further more the unit tests for the documentation are also included in the project’s test report, which is also not desired.
I haven’t looked into it but with Gradle I think I can setup different SourceSets
to separate them.
I think it would be good to add something like this to the docs or maybe even making it easier for users by providing a specific restdocs plugin which setups these SrouceSets
automatically.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
A separate sourceset is overkill IMHO, just use JUnit categories, or simple naming conventions with include-exclude rules. Just as maven surefire/failsafe use
*Test
/*IT
. You could use*AT
for ApiTestYou make a good point, @leonard84. Thank you. Given that this is largely down to personal preference, and that exactly how you split things up depends on that preference, the build system you’re using, and the test framework that you’re using, I now think it is out of the scope of REST Docs’ own documentation.