-
Notifications
You must be signed in to change notification settings - Fork 225
Add tests against downstream project (datafaker-gen) #1171
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
PR Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1171 +/- ##
============================================
+ Coverage 92.35% 92.46% +0.11%
- Complexity 2821 2839 +18
============================================
Files 292 293 +1
Lines 5609 5615 +6
Branches 599 598 -1
============================================
+ Hits 5180 5192 +12
+ Misses 275 271 -4
+ Partials 154 152 -2 ☔ View full report in Codecov by Sentry. |
.github/workflows/maven.yml
Outdated
| name: Jdk ${{ matrix.java-version }}, os ${{ matrix.runs-on }} | ||
| runs-on: ${{ matrix.runs-on }} | ||
| outputs: | ||
| output1: ${{ steps.getProjectVersion.outputs.test }} |
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.
Why not actually call it version or something meaningful?
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.
still playing to get something working
after that will rename it
|
//cc @bodiam since you were asking about something like this |
| cache: maven | ||
| - name: Build with Maven | ||
| run: ./mvnw $mvn_options verify -PnoGpg --file pom.xml | ||
| run: ./mvnw $mvn_options install -PnoGpg --file pom.xml |
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.
we need install since during tests with downstream project these artifacts will be reused
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.
What would you think of turning all the tests of Datafaker into a test artifact, and run them as part of the downstream project?
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 guess most of them are independent whether they are running within Datafaker code or some downstream projects.
There are only few of them where it works differently.
Also there will be another challenge: how to make it possible
I see several solutions and none of them is perfect
- copy-paste of tests however it means we need to maintain 2 repos synced at least from tests point of view
- we could publish
test-jarand reuse it in downstream project however anyway need to create a bunch of child classes and keep it sync (e.g. each time a new test class is appearing in Datafaker we need to create a corresponding child in third party) - something else that I don't know yet
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.
Sorry, I don't understand point 2. Why would we need to create child classes? The idea I had was to indeed create a test artifact, put all the tests in there, and use surefire to run the tests against the jar. I'm not sure if we do some magic which prevents this?
Alternatively, I think we need only 1 test, which is very similar to the repeatability test : just call every in the public api and make sure it returns something. That would have stopped a few bugs from being released.
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.
May be I missed something however I thought that tests will not run if we just add a test-jar dependency without any usage of that
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.
Well, here it says we could run them if we package them up and give them to surefire, unless I'm misunderstanding something:
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.
may be makes sense to try it once more
not sure when will have time for this
|
Sorry I missed the request on this one. It does look good 🙂 |
the idea is to get main repo from datafaker-gen and build it and then run tests against latest datafaker version to be able to detect issue appearing only in downstream projects like e.g. #1170 or #1168
currently this check is done only in case of jdk21 and ubuntu (in fact i do not see a real reason to test it with the whole matrix)