This is an automated email from the ASF dual-hosted git repository.

more pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 73ddf0218 KNOX-3226 - Report integration results to PR (#1122)
73ddf0218 is described below

commit 73ddf021871f8f23a3e0286de00c9005a1939ce3
Author: Sandeep MorĂ© <[email protected]>
AuthorDate: Mon Dec 8 15:23:50 2025 -0500

    KNOX-3226 - Report integration results to PR (#1122)
    
    * KNOX-3226 - Report integration results to PR
---
 .github/workflows/compose/docker-compose.yml |  2 +-
 .github/workflows/publish-test-results.yml   | 50 ++++++++++++++++++++++++++++
 .github/workflows/tests.yml                  | 17 ++++++++++
 .github/workflows/tests/requirements.txt     |  4 +--
 .gitignore                                   |  4 +++
 5 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/compose/docker-compose.yml 
b/.github/workflows/compose/docker-compose.yml
index b114d3ae0..601c6b8ca 100644
--- a/.github/workflows/compose/docker-compose.yml
+++ b/.github/workflows/compose/docker-compose.yml
@@ -56,7 +56,7 @@ services:
       bash -c "pip install -r requirements.txt 
       && echo 'Waiting for knox...' 
       && sleep 30 
-      && python -m unittest discover -p 'test_*.py'"
+      && pytest --junitxml=test-results.xml"
     depends_on:
       - knox
 
diff --git a/.github/workflows/publish-test-results.yml 
b/.github/workflows/publish-test-results.yml
new file mode 100644
index 000000000..54627b00c
--- /dev/null
+++ b/.github/workflows/publish-test-results.yml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Publish Test Results
+
+on:
+  workflow_run:
+    workflows: ["Apache Knox Docker Compose Tests"]
+    types:
+      - completed
+
+jobs:
+  publish-test-results:
+    runs-on: ubuntu-latest
+    if: >
+      github.event.workflow_run.event == 'pull_request' &&
+      github.event.workflow_run.conclusion != 'cancelled'
+    permissions:
+      checks: write
+      pull-requests: write
+      contents: read
+      actions: read
+    steps:
+      - name: Download and Extract Artifacts
+        uses: actions/download-artifact@v4
+        with:
+          run_id: ${{ github.event.workflow_run.id }}
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          path: artifacts
+
+      - name: Publish Test Results
+        uses: EnricoMi/publish-unit-test-result-action@v2
+        with:
+          commit: ${{ github.event.workflow_run.head_sha }}
+          event_file: artifacts/Event File/event.json
+          event_name: ${{ github.event.workflow_run.event }}
+          files: "artifacts/**/*.xml"
+
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 1e7fd425b..72e07fa2b 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -25,6 +25,10 @@ jobs:
   build-and-test:
     if: github.event_name != 'pull_request' || 
!contains(github.event.pull_request.labels.*.name, 'skip-tests')
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      checks: write
+      pull-requests: write
 
     env:
       KNOX_URL: "https://github.com/apache/knox.git";
@@ -78,6 +82,19 @@ jobs:
           # Run the tests service defined in docker-compose.yml
           docker compose -f ./.github/workflows/compose/docker-compose.yml up 
--exit-code-from tests tests
 
+      - name: Upload Test Results
+        if: (!cancelled())
+        uses: actions/upload-artifact@v4
+        with:
+          name: test-results
+          path: .github/workflows/tests/test-results.xml
+
+      - name: Upload Event File
+        uses: actions/upload-artifact@v4
+        with:
+          name: Event File
+          path: ${{ github.event_path }}
+
       - name: Tear Down Docker Compose
         if: always()
         run: docker compose -f ./.github/workflows/compose/docker-compose.yml 
down --volumes
diff --git a/.github/workflows/tests/requirements.txt 
b/.github/workflows/tests/requirements.txt
index 3288e9274..b328d990f 100644
--- a/.github/workflows/tests/requirements.txt
+++ b/.github/workflows/tests/requirements.txt
@@ -1,2 +1,2 @@
-requests
-
+requests==2.32.3
+pytest==8.3.4
diff --git a/.gitignore b/.gitignore
index 89404ec1e..4bda3970c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,7 +38,11 @@ velocity.log
 *.patch
 .checkstyle
 **/package-lock.json
+
+# Workflow rules
 .github/workflows/compose/logs/*
+.github/workflows/tests/test-results.xml
+
 
 # other IDEs and editors
 .vscode

Reply via email to