feat: customizeable recording file name#143
feat: customizeable recording file name#143JonasPammer wants to merge 24 commits intoapache:4.2.xfrom JonasPammer:geb-133-serviceloader
Conversation
There was a problem hiding this comment.
Awesome @JonasPammer, thank you for this PR!
I do have some concern for the tests, in that now all tests will use the custom implementation, and no tests will use the default implementation. If we create and use a TestDescriptionServiceFactory and call that instead of the ServiceLoader directly, we can modify the implementation programatically in setupSpec() and cleanupSpec().
Also, I think we should target the 4.2.x branch with this PR as we have not yet released a 4.2.0 version.
What do you think?
|
Totally! I saw other 2 projects in grails/spock also use a seperate class (i think there called loader), will implement thanks to your helpful guiding comments. |
Force Push Explanation[changed pr base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) |
|
This PR (and, also seeing you there ;) gets me to also maybe open a PR in grails-docs for minor fixes found along the way, its fun i am happy to drop some commits if desired, e.g. the last one - [add ContainerGebConfiguration ability](a9045bf) |
src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy
Outdated
Show resolved
Hide resolved
...r-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionImpl.groovy
Show resolved
Hide resolved
...r-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionImpl.groovy
Outdated
Show resolved
Hide resolved
|
@JonasPammer Thank you for taking the time on this. I had only minor comments / cleanup. |
matrei
left a comment
There was a problem hiding this comment.
Excellent! I have some minor suggestions/questions.
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceFactory.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy
Outdated
Show resolved
Hide resolved
.../src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionAnnotationSpec.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy
Outdated
Show resolved
Hide resolved
...r-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionSpec.groovy
Outdated
Show resolved
Hide resolved
|
thanks for helping me improve, will implement changes sometime tomorrow |
|
left 2 comments open ended to either be resolved or answered with that we should do it the way written |
matrei
left a comment
There was a problem hiding this comment.
Nice! Just some follow up comments/suggestions.
.../src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionAnnotationSpec.groovy
Outdated
Show resolved
Hide resolved
.../src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionAnnotationSpec.groovy
Outdated
Show resolved
Hide resolved
...r-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionSpec.groovy
Outdated
Show resolved
Hide resolved
...c/integration-test/resources/META-INF/services/grails.plugin.geb.ContainerGebTestDescription
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceLoader.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceLoader.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/DefaultContainerGebTestDescription.groovy
Outdated
Show resolved
Hide resolved
src/testFixtures/groovy/grails/plugin/geb/GebRecordingTestListener.groovy
Outdated
Show resolved
Hide resolved
|
👍 |
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceLoader.groovy
Outdated
Show resolved
Hide resolved
...r-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionImpl.groovy
Show resolved
Hide resolved
|
last commit can be dropped, i wanted to hold a grail to the actual code of your alls which this plugin is about to not be bloated by java design patterns necessities of 4 classes |
|
Thanks @JonasPammer, I think we can drop the last commit for now (it might actually be a breaking change in 4.x). |
|
Talking of breaking changes. Changing |
|
if its just about the namespacing, i could make |
It was internal only so I think it's ok in this case. |
|
given |
src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy
Show resolved
Hide resolved
|
@JonasPammer Should we go in the direction of a more general service loader instead, because it looks like really usable extension point mechanism that can be useful for more cases: #146 (comment) |
|
set do draft as per above comment linked PR design decision WIP |
README.md text was copied with template from https://github.com/spockframework/spock/blob/master/docs/extensions.adoc#global-extensions I tried to get knowledge about this ServiceLoader paradigm from https://github.com/search?q=org%3Agrails+repo%3Agrails%2Fgrails-core+ServiceLoader.load&type=code and https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html class javadoc Although this whole META-INF is weird to me, I did not find it necessary to implement something complex like https://github.com/spockframework/spock/blob/620f8734fb51c26cc9c8b8aade8d4dedc1532b94/spock-core/src/main/java/org/spockframework/runtime/ConfigurationScriptLoader.java#L34 (try to load env var path, file system, ..) into this just for this # Conflicts: # README.md
"left-shift cannot be applied to ..."
commit/file/folder can be removed, as documentation is clear
as done by 947eb0a
although default doesnt use it, as to not change default behaviour with this PR, one may want to?
…/faking possibility? just an idea
intellij refactor + Spec needed manually
|
as per apache/grails-core#14330 i understand when this will be closed i will reopen a new version in core |
|
@JonasPammer you should be safe to open this against grails core now. grails-geb is the source location in core |
Resolves apache/grails-core#14329
PR Appendix to last paragraph: Maybe the first one (env var) seems like a viable alternative/addition to this pattern, given that all other settings can be managed through
systemProperty 'grails.geb.recording.*'*'``, i did not roll with using it instead as to first try to do it as per agreed upon https://github.com/grails/geb/issues/133#issuecomment-2654122264, and to possibly get validation if i did the ServiceLoader Pattern right ❤️ 💭