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
Split modules #2564
Split modules #2564
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.
This change is really awesome because I've already tried before without success due to my lack of knowledge of gradle.
Thanks a lot! 🙏
build-logic/publishing/src/main/kotlin/testng.maven-publish.gradle.kts
Outdated
Show resolved
Hide resolved
core-api/src/main/java/org/testng/internal/objects/InstanceCreator.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/org/testng/internal/reflect/ReflectionHelper.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/org/testng/reporters/FileStringBuffer.java
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,73 @@ | |||
#### Dependencies and Plugin versions with their available updates. | |||
#### Generated by `./gradlew refreshVersions` version 0.10.0 |
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.
I didn't know it before, it looks awesome!
@krmahadevan FYI https://jmfayard.github.io/refreshVersions/update-dependencies/
Just need to fix the build and add an entry in the CHANGES file ;) |
@juherr , well, you are optimistic :) What I did was I pulled For instance, On the other hand, it is not clear what is the nature of Then, the change creates "split package" issue where |
PS. @juherr , @krmahadevan , do you prefer |
Yes!! 🤩
Agree, or in a
It is the entry point for integrations: ant, maven, gradle, intellij, eclipse, netbeans and maybe more (like our own tests) use it to run tests.
I think |
I'm really excited about these changes! 😍 We use gradle for a while now but the move from Maven is still difficult. |
Could you please clarify? AFAIK Maven is no longer used for building TestNG.
If you like, we can setup a small (Zoom?) call so I can walk you through the idea behind the change. |
We moved to Gradle but we still don't manage it very well 🤷♂️
Good idea! |
Maybe reporter/reporter-api or some others but could be done later because the current change is already big enough without too much code changes. |
Well, having several modules helps to validate the idea and it helps to figure out better naming. Now it looks like the gain here is as follows:
|
I validate the plan! About the modules, I don't know what will be the best cut but last time I tried, I had:
Some of these modules need code refactoring, that's why I'd prefer to introduce them only once the structure with only-moved-classes-not-refactoring will be validated and merged :) Ping @krmahadevan Could you have a look at the current change and tell us if you agree with the objective? |
That's my understanding as well. For now, I do only code movement with minimal cleanups. |
It looks like |
It looks like |
Sample chart. Legend:
|
@juherr - Am still trying to catch up with the updates on this. So please bear with me if the questions sound naive. Can you please help me understand what usecases would the below modules solve for a user from being a TestNG user perspective ?
Because I am not sure I quite understand as to why do we need to get down to this level of a code break-up ? Fundamentally speaking, what is the idea of breaking down the codebase into multiple modules aimed at solving ? Is it something like the spring framework providing multiple projects as individual components which a user can consume ? If thats the idea, then I dont quite understand as to when would a user want to use just these modules ? They are in one or the other way tied to tesng-core. I was hoping that we would have something much more macro level for e.g.,
Now I am still not sure how would we extract it, but a The reports module in my opinion doesn't add a lot of value addition because we are looking at thinning down the number of default reporters that TestNG offers (beyond the textual, xml and emailable report). So why do we need to have just another module only for these 3 features (which I think is technically just 3 reporting classes) ? |
a) For instance, if I want to create tests, I need b) Moving c) Building separate modules helps to ensure the clients would be able to do the same. For instance, if they want to build TestNG suites from their custom formats, then they would need more or less the same APIs as the current |
My main goal is not for users but for the core team.
It is more a side effect, but yes :) @vlsi already gives some use-cases.
First, a good practice is to separate API and implementation: testng-api + testng-core
In my mind, we can group all default reporters into a single module. The users will have to choose. |
While I agree with you the circular layer, I am not sure if the package interdependencies is that big of a problem. Maybe that's the ignorance in me speaking.
Yes this is the very same concern I have that if we end up having a lot of modules, then we may perhaps loose the benefits of multiple modules, because then release may become a problem (This may not be actually true, but just still calling this out)
When you say TestNG API, are you referring to the interfaces being created by TestNG and by implementation are you referring to the interface implementations ?
I didn't quite understand this part. Can you please help explain this once more to me ? |
Right. It will depend on why and when you make packages.
Releases should not be more difficult than today: the same repository today and someone else problem if a module is dropped outside :)
Yes, testng-api is testng interfaces (for test descriptions and feature implementations aka SPI). |
By the way, Guice injection is configurable (see https://github.com/google/guice/wiki/CustomInjections ), and it might be it is enough to cover all TestNG injection use cases. |
Ok, I am not sure i still understand the broader picture. Since you have a much more clearer idea on this, i think i will side step and let you help drive this to closure, while i catch up on the concepts :) |
@juherr , what do you think if individual jars are not published to Central until they are fully ready (e.g. split packages resolved)? There might be options: |
@juherr, do you manually close staging repositories at https://oss.sonatype.org/ ? Frankly speaking, I use https://github.com/vlsi/vlsi-release-plugins/blob/master/plugins/stage-vote-release-plugin/README.md for publishing to Central. Publishing multi-module projects would require https://github.com/gradle-nexus/publish-plugin to orchestrate the publishing, so we'd better configure the publishing even in case initially there will be only a single module published. I can configure stage-vote-release-plugin here if you will, however, I am not sure if it would align with your workflows. The key difference probably is that I tend avoid storing The release procedure would be like:
I use the plugin for quite a while now in pgjdbc, Apache Calcite, Apache JMeter, etc. |
I think the option c is the best: publish all artifacts in the next major version
For the moment, yes. |
I've made a couple of corrections:
The resulting |
4f72621
to
a0149ae
Compare
…tNG (testng-core)
Ok, I updated the changelog, and I even fixed OSGi headers. Not sure if testng works, however, previously it failed to load at all, and now it loads, and one can query its version via |
I reviewed and see 3 little issues:
Now, I'm trying to load your branch before merging. |
What do you mean?
Same thing. I replaced
Well, I borrowed code from pgjdbc which is BSD-2-Clause. I believe it is compatible with testng. I can remove the code if you do not like borrowing. PS. What do you think of |
I vote for |
Note: below tricks might help to hide file movements:
A) GitHub UI: scroll the diff ("files changed") to the very end, and type the following to the browser console:
$$('div.empty').forEach(function(e) { e.parentElement.parentElement.style.display='none'; })
B) You can watch individual commits (e.g. open Commits ) and review individual ones
C) You can use
git log -M30% -l0 --stat -p -G.
on the command line to show non-trivial diffs only (hide movements)D) You can use
git diff -M30% -l0 --stat -p -G. origin/master
to see the full diffNote GitHub has a limit on the number of renamed files, so sometimes it shows a file as "deleted and inserted" even if that was a simple rename.
-l0
can be used to set "unlimited" number of "renamed files" ingit diff
/git log
.The true diff (excluding file movements) is
85 files changed, 1617 insertions(+), 812 deletions(-)
Open questions:
Probably resolved:
testng-*
be published (see Split modules #2564 (comment))? -- not for nowTODO:
testng-core-api
(for now guice is optional in API)/core/build.gradle.kts
(removeobject This
and so on)