From 9ff9d9230ef015d5087e549c796641a9e1604431 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Mon, 19 May 2025 10:40:03 +0200 Subject: [PATCH] Fix test results parsing error (#145077) --- .github/workflows/ci.yaml | 32 ++++++++++++++++++++++++---- tests/components/backup/test_util.py | 5 +++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53de33b99e4..4a202a0c9d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -944,7 +944,8 @@ jobs: bluez \ ffmpeg \ libturbojpeg \ - libgammu-dev + libgammu-dev \ + libxml2-utils - name: Check out code from GitHub uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} @@ -1020,6 +1021,11 @@ jobs: name: coverage-${{ matrix.python-version }}-${{ matrix.group }} path: coverage.xml overwrite: true + - name: Beautify test results + # For easier identification of parsing errors + run: | + xmllint --format "junit.xml" > "junit.xml-tmp" + mv "junit.xml-tmp" "junit.xml" - name: Upload test results artifact if: needs.info.outputs.skip_coverage != 'true' && !cancelled() uses: actions/upload-artifact@v4.6.2 @@ -1070,7 +1076,8 @@ jobs: bluez \ ffmpeg \ libturbojpeg \ - libmariadb-dev-compat + libmariadb-dev-compat \ + libxml2-utils - name: Check out code from GitHub uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} @@ -1154,6 +1161,11 @@ jobs: steps.pytest-partial.outputs.mariadb }} path: coverage.xml overwrite: true + - name: Beautify test results + # For easier identification of parsing errors + run: | + xmllint --format "junit.xml" > "junit.xml-tmp" + mv "junit.xml-tmp" "junit.xml" - name: Upload test results artifact if: needs.info.outputs.skip_coverage != 'true' && !cancelled() uses: actions/upload-artifact@v4.6.2 @@ -1202,7 +1214,8 @@ jobs: sudo apt-get -y install \ bluez \ ffmpeg \ - libturbojpeg + libturbojpeg \ + libxml2-utils sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y sudo apt-get -y install \ postgresql-server-dev-14 @@ -1290,6 +1303,11 @@ jobs: steps.pytest-partial.outputs.postgresql }} path: coverage.xml overwrite: true + - name: Beautify test results + # For easier identification of parsing errors + run: | + xmllint --format "junit.xml" > "junit.xml-tmp" + mv "junit.xml-tmp" "junit.xml" - name: Upload test results artifact if: needs.info.outputs.skip_coverage != 'true' && !cancelled() uses: actions/upload-artifact@v4.6.2 @@ -1357,7 +1375,8 @@ jobs: bluez \ ffmpeg \ libturbojpeg \ - libgammu-dev + libgammu-dev \ + libxml2-utils - name: Check out code from GitHub uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} @@ -1436,6 +1455,11 @@ jobs: name: coverage-${{ matrix.python-version }}-${{ matrix.group }} path: coverage.xml overwrite: true + - name: Beautify test results + # For easier identification of parsing errors + run: | + xmllint --format "junit.xml" > "junit.xml-tmp" + mv "junit.xml-tmp" "junit.xml" - name: Upload test results artifact if: needs.info.outputs.skip_coverage != 'true' && !cancelled() uses: actions/upload-artifact@v4.6.2 diff --git a/tests/components/backup/test_util.py b/tests/components/backup/test_util.py index 229e25c312d..af37a3b88a6 100644 --- a/tests/components/backup/test_util.py +++ b/tests/components/backup/test_util.py @@ -112,6 +112,11 @@ from tests.common import get_fixture_path ), ), ], + ids=[ + "no addons and no metadata", + "with addons and metadata", + "only metadata", + ], ) def test_read_backup(backup_json_content: bytes, expected_backup: AgentBackup) -> None: """Test reading a backup."""