-
Notifications
You must be signed in to change notification settings - Fork 9
feat: customizeable recording file name #143
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
b2076f6 to
8186a9b
Compare
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
058d3b2 to
3fceea4
Compare
|
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 |
|
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
d336f0b to
41b4590
Compare
|
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 ❤️ 💭