From 040d36322eceb0ddc6a0704613a4070cf9cdbfae Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 30 Jul 2026 10:16:58 +0100 Subject: [PATCH 1/2] [DOCS] odoo_test_xmlrunner: update example Update the module documentation example to a minimal GitHub Actions workflow that shows how to load odoo_test_xmlrunner with --load so its test-suite patch is active and writes reports to test_results/*.xml. Assisted-by: OpenCode + ollama-cloud/kimi-k2.7-code --- odoo_test_xmlrunner/README.rst | 50 +++--------- odoo_test_xmlrunner/readme/USAGE.md | 44 +++-------- .../static/description/index.html | 78 ++++++------------- 3 files changed, 42 insertions(+), 130 deletions(-) diff --git a/odoo_test_xmlrunner/README.rst b/odoo_test_xmlrunner/README.rst index 9c7913840b0..d2bfbdde29b 100644 --- a/odoo_test_xmlrunner/README.rst +++ b/odoo_test_xmlrunner/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ====================== Unittest xUnit reports ====================== @@ -17,7 +13,7 @@ Unittest xUnit reports .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github @@ -108,59 +104,33 @@ Add the following job to your ``.github/workflows/main.yml`` file: name: tests - permissions: - contents: read - checks: write - id-token: write - on: - push: - branches: ["main"] - tags: ["*"] pull_request: + push: jobs: test: runs-on: ubuntu-22.04 - container: ${{ matrix.container }} - name: ${{ matrix.name }} - strategy: - fail-fast: false - matrix: - include: - - container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest - name: test with Odoo services: postgres: - image: postgres:12.0 + image: postgres:17 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo POSTGRES_DB: odoo ports: - 5432:5432 + env: + DB: odoo steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Install addons and dependencies - run: oca_install_addons - - name: Check licenses - run: manifestoo -d . check-licenses - - name: Check development status - run: manifestoo -d . check-dev-status --default-dev-status=Beta - - name: Initialize test db - run: oca_init_test_database + - uses: actions/checkout@v4 - name: Run tests - run: oca_run_tests - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - name: Publish Test Report + run: odoo --load=odoo_test_xmlrunner -i my_module --test-enable --stop-after-init + - name: Publish test report uses: mikepenz/action-junit-report@v4 - if: success() || failure() # always run even if the previous step fails + if: success() || failure() with: - report_paths: 'test_results/*.xml' + report_paths: test_results/*.xml Bug Tracker =========== diff --git a/odoo_test_xmlrunner/readme/USAGE.md b/odoo_test_xmlrunner/readme/USAGE.md index 6e22e01c08a..7b09426192c 100644 --- a/odoo_test_xmlrunner/readme/USAGE.md +++ b/odoo_test_xmlrunner/readme/USAGE.md @@ -51,58 +51,32 @@ Add the following job to your `.github/workflows/main.yml` file: ```yaml name: tests -permissions: - contents: read - checks: write - id-token: write - on: - push: - branches: ["main"] - tags: ["*"] pull_request: + push: jobs: test: runs-on: ubuntu-22.04 - container: ${{ matrix.container }} - name: ${{ matrix.name }} - strategy: - fail-fast: false - matrix: - include: - - container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest - name: test with Odoo services: postgres: - image: postgres:12.0 + image: postgres:17 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo POSTGRES_DB: odoo ports: - 5432:5432 + env: + DB: odoo steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Install addons and dependencies - run: oca_install_addons - - name: Check licenses - run: manifestoo -d . check-licenses - - name: Check development status - run: manifestoo -d . check-dev-status --default-dev-status=Beta - - name: Initialize test db - run: oca_init_test_database + - uses: actions/checkout@v4 - name: Run tests - run: oca_run_tests - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - name: Publish Test Report + run: odoo --load=odoo_test_xmlrunner -i my_module --test-enable --stop-after-init + - name: Publish test report uses: mikepenz/action-junit-report@v4 - if: success() || failure() # always run even if the previous step fails + if: success() || failure() with: - report_paths: 'test_results/*.xml' + report_paths: test_results/*.xml ``` diff --git a/odoo_test_xmlrunner/static/description/index.html b/odoo_test_xmlrunner/static/description/index.html index e71f15fb742..eb1c8701d5e 100644 --- a/odoo_test_xmlrunner/static/description/index.html +++ b/odoo_test_xmlrunner/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Unittest xUnit reports -
+
+

Unittest xUnit reports

- - -Odoo Community Association - -
-

Unittest xUnit reports

-

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

This module generate unittest reports using unittest-xml-reporting tool.

Table of contents

@@ -398,19 +393,19 @@

Unittest xUnit reports

-

Installation

+

Installation

Install python library https://pypi.org/project/unittest-xml-reporting/

The module is automatically installed on the Odoo instance.

-

Usage

+

Usage

-

Run the native Odoo tests

+

Run the native Odoo tests

Run the native Odoo tests. See the Odoo documentation for more information.

-

Gitlab CI usage example

+

Gitlab CI usage example

Add the following job to your .gitlab-ci.yml file:

 stages:
@@ -450,70 +445,44 @@ 

Gitlab CI usage example

-

Github Actions usage example

+

Github Actions usage example

Add the following job to your .github/workflows/main.yml file:

 name: tests
 
-permissions:
-    contents: read
-    checks: write
-    id-token: write
-
 on:
-  push:
-    branches: ["main"]
-    tags: ["*"]
   pull_request:
+  push:
 
 jobs:
   test:
     runs-on: ubuntu-22.04
-    container: ${{ matrix.container }}
-    name: ${{ matrix.name }}
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest
-            name: test with Odoo
     services:
       postgres:
-        image: postgres:12.0
+        image: postgres:17
         env:
           POSTGRES_USER: odoo
           POSTGRES_PASSWORD: odoo
           POSTGRES_DB: odoo
         ports:
           - 5432:5432
+    env:
+      DB: odoo
     steps:
-      - uses: actions/checkout@v3
-        with:
-          persist-credentials: false
-      - name: Install addons and dependencies
-        run: oca_install_addons
-      - name: Check licenses
-        run: manifestoo -d . check-licenses
-      - name: Check development status
-        run: manifestoo -d . check-dev-status --default-dev-status=Beta
-      - name: Initialize test db
-        run: oca_init_test_database
+      - uses: actions/checkout@v4
       - name: Run tests
-        run: oca_run_tests
-      - uses: codecov/codecov-action@v4
-        with:
-          token: ${{ secrets.CODECOV_TOKEN }}
-      - name: Publish Test Report
+        run: odoo --load=odoo_test_xmlrunner -i my_module --test-enable --stop-after-init
+      - name: Publish test report
         uses: mikepenz/action-junit-report@v4
-        if: success() || failure() # always run even if the previous step fails
+        if: success() || failure()
         with:
-          report_paths: 'test_results/*.xml'
+          report_paths: test_results/*.xml
 
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -521,15 +490,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Smile
-

Other credits

+

Other credits

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -555,6 +524,5 @@

Maintainers

-
From 168b62d7d12b64d53faa7ac332451469fcca1a47 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 30 Jul 2026 10:17:24 +0100 Subject: [PATCH 2/2] [BUILD]: publish JUnit reports in CI Configure the GitHub Actions workflow to publish the xUnit XML test reports generated by odoo_test_xmlrunner using mikepenz/action-junit-report. Also make Codecov upload run even if tests fail, so coverage data is not lost on failure. Assisted-by: OpenCode + kimi-k2.7-code --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0139a2bdc6a..8522634d2f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,8 +66,14 @@ jobs: - name: Run tests run: oca_run_tests - uses: codecov/codecov-action@v4 + if: success() || failure() with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Publish test report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() + with: + report_paths: test_results/*.xml - name: Update .pot files run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}