[ 
https://issues.apache.org/jira/browse/NUTCH-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028940#comment-18028940
 ] 

ASF GitHub Bot commented on NUTCH-3126:
---------------------------------------

lewismc commented on PR #863:
URL: https://github.com/apache/nutch/pull/863#issuecomment-3388228701

   After some thinking I revisited this today. I learned quite a few things
   
   1. In order for the [mikepenz/action-junit-report 
action](https://github.com/mikepenz/action-junit-report) to create check runs 
and post comments, we need to grant `checks: write` and `pull-requests: write` 
permissions. This causes an issue/it doesn't work as part of the 
`master-build.yml` workflow because for pull requests from forked repositories 
GitHub restricts the default token to read-only access for security purposes. 
So in order to keep moving forward I created a complementary (downstream) 
`workflow_run` workflow named `junit-report.yml` which run with the correct 
permissions.
   2. Because we run build and tests on a matrix of OS's (currently linux & 
macos both with Java 11) I had to introduce an action which would first upload 
JUnit test XML reports (implemented in `master-build.yml`) and another action 
which would later download the results (implemented in `junit-report.yml`) to 
report on them. The issue I came across is that because we have the matrix 
setup, we potentially upload the JUnit test report artifact more than once. In 
order to overcome that I currently overwrite the artifact so only one exists 
which is then used in the `workflow_run` workflow. 
   3. The `workflow_run` event will only trigger a workflow run if the workflow 
file is on the default branch (`master`)... which it cannot be until it is 
merged into `master`. 
   4. I discovered that [TestMimeUtil.java is not writing any output to the XML 
file](https://ci-builds.apache.org/job/Nutch/job/Nutch-trunk/lastCompletedBuild/testReport/TEST-org.apache.nutch.util.TestMimeUtil/xml/_empty_/).
 So I will investigate that separately. For now I've disabled the check for 
erroneous test report XML files but once I fix this issue I will reactivate 
this check.
   
   So with that being said
   
   1. All testing behavior is unaffected. 
   2. I will merge this PR into `master` branch so that I can validate the 
`workflow_run` workflow can be triggered. I will validate this by closing 
https://github.com/apache/nutch/pull/865 and then reopening it... which will 
trigger a CI run and hopefully trigger the `workflow_run` workflow if the 
`master-build` was successful.




> Report JUnit test results in GitHub pull request thread
> -------------------------------------------------------
>
>                 Key: NUTCH-3126
>                 URL: https://issues.apache.org/jira/browse/NUTCH-3126
>             Project: Nutch
>          Issue Type: Task
>          Components: ci/cd, test
>            Reporter: Lewis John McGibbney
>            Assignee: Lewis John McGibbney
>            Priority: Minor
>             Fix For: 1.22
>
>
> It can be difficult to tell which test(s) make a Nutch build unstable through 
> errors or failures. 
> The [JUnit Report 
> Action|https://github.com/marketplace/actions/junit-report-action] can be 
> used to report JUnit test results as a check in the GitHub pull request which 
> would provide the benefit of identifying exactly which line of test code 
> produced an anomaly and what the anomaly is.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to