-
Notifications
You must be signed in to change notification settings - Fork 348
[Enchancement] Removed dependency between "test" and "jacocoTestReport" #2935
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
Merged
DarshitChanpura
merged 1 commit into
opensearch-project:main
from
pawel-gudel-eliatra:issue-2913
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think this is the right thing to do: Gradle uses build cache (see please [1]) which should run
testtask only once. The build essentially becomes unusable for regular contributors since they have to closely follow whatever the GA workflow does, not just run./gradlew checkand get the code coverage.[1] https://docs.gradle.org/current/userguide/build_cache.html#sec:task_output_caching_details
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.
Unfortunately I do not understand the issue here. Running
./gradlew checkdoes not disable creation of code coverage report. Output below:When you start
testthe code coverage ("jacocoTestReport" task) is always started. This PR only removed reverse dependency: a situation when running./gradlew jacocoTestReportalso forcestestto be run.Uh oh!
There was an error while loading. Please reload this page.
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.
And
That is coming from:
Exactly, and this is my question - the
jacocoTestReportby definition needs test to be run (otherwise there is no input to build the report), so if one runs./gradlew jacocoTestReportit would make sense to have tests to be run beforeHowever, if ones run those two in sequence
./gradlew test./gradlew jacocoTestReportThe
jacocoTestReportshould not cause test to be rerunUh oh!
There was an error while loading. Please reload this page.
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.
Unfortunately I still do not quite understand issue here. I'll try to answer one-by-one:
Yes, it needs to be run but not as a separate task. It is run always after the "test" task.
What should make sense is to start "test", not "jacocoTestReport".
This is not the scope of this PR. I don't understand why would you like to "jacocoTestReport" as a separate task after running "test" ("jacocoTestReport" is always started after "test" already!). In your execution of two command Gradle runs following things:
Why would someone like to do that? Just run "
./gradlew test" once and get both "test" and "jacocoTestReport" in the same run.Also, I've verified and "check" job starts "jacocoTestReport" but only as a part of "test" job. This PR does not break creation of code coverage by running "check" task.
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.
@peternied adding you as discussed
From our point of view
is the only thing a dev on their local system would need. Not sure if we are missing 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.
I think this is the core of the issue:
testdoes not needjacocoTestReport(one could run tests without coverage)jacocoTestReportneedstest(one needs tests for the reports)I think removing this dependency would make sense
but not the dependency between
testandjacocoTestReportThere 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.
@nibix if
./gradlew testassumes tests and coverage report (which at least in OpenSearch core is two separated tasks at the moment), than the change is fine.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 would recommend that executing tests is separate from the generation of a coverage report. As we have many checks that are only defined by GitHub Actions.
I've created an issue to track this area and to solict more feedback.