From d5f7f4339f5bd47a1c07aca7b7f0f94f5eb5135a Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:58:09 +0000 Subject: [PATCH] Base CI tweaks for debugging flaky test --- .github/workflows/ci.yaml | 39 ++++++++---------------------------- .gitignore | 2 +- pytest_buckets.txt | 4 ++++ tests/components/conftest.py | 5 +---- 4 files changed, 14 insertions(+), 36 deletions(-) create mode 100644 pytest_buckets.txt diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9e5b91aff2..4cc2e6485a7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,7 +5,7 @@ run-name: "${{ github.event_name == 'workflow_dispatch' && format('CI: {0}', git on: push: branches: - - dev + - dev_debug_translation_issue - rc - master pull_request: ~ @@ -198,6 +198,8 @@ jobs: skip_coverage="true" fi + test_groups="[4]" + # Output & sent to GitHub Actions echo "mariadb_groups: ${mariadb_groups}" echo "mariadb_groups=${mariadb_groups}" >> $GITHUB_OUTPUT @@ -658,6 +660,7 @@ jobs: if: | github.event.inputs.mypy-only != 'true' && github.event.inputs.audit-licenses-only != 'true' + && 'true' == 'false' || github.event.inputs.pylint-only == 'true' needs: - info @@ -704,6 +707,7 @@ jobs: if: | (github.event.inputs.mypy-only != 'true' && github.event.inputs.audit-licenses-only != 'true' + && 'true' == 'false' || github.event.inputs.pylint-only == 'true') && (needs.info.outputs.tests_glob || needs.info.outputs.test_full_suite == 'true') needs: @@ -821,36 +825,8 @@ jobs: - base name: Split tests for full run steps: - - name: Install additional OS dependencies - run: | - sudo rm /etc/apt/sources.list.d/microsoft-prod.list - sudo apt-get update - sudo apt-get -y install \ - bluez \ - ffmpeg \ - libturbojpeg \ - libgammu-dev - name: Check out code from GitHub uses: actions/checkout@v4.2.2 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.3.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Restore base Python virtual environment - id: cache-venv - uses: actions/cache/restore@v4.1.2 - with: - path: venv - fail-on-cache-miss: true - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.info.outputs.python_cache_key }} - - name: Run split_tests.py - run: | - . venv/bin/activate - python -m script.split_tests ${{ needs.info.outputs.test_group_count }} tests - name: Upload pytest_buckets uses: actions/upload-artifact@v4.4.3 with: @@ -941,11 +917,10 @@ jobs: echo "Test group ${{ matrix.group }}: $(sed -n "${{ matrix.group }},1p" pytest_buckets.txt)" python3 -b -X dev -m pytest \ - -qq \ + -x \ --timeout=9 \ --durations=10 \ --numprocesses auto \ - --snapshot-details \ --dist=loadfile \ ${cov_params[@]} \ -o console_output_style=count \ @@ -989,6 +964,7 @@ jobs: && github.event.inputs.mypy-only != 'true' && github.event.inputs.audit-licenses-only != 'true' && needs.info.outputs.mariadb_groups != '[]' + && 'true' == 'false' needs: - info - base @@ -1116,6 +1092,7 @@ jobs: && github.event.inputs.mypy-only != 'true' && github.event.inputs.audit-licenses-only != 'true' && needs.info.outputs.postgresql_groups != '[]' + && 'true' == 'false' needs: - info - base diff --git a/.gitignore b/.gitignore index 241255253c5..1ffc627adbc 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,4 @@ tmp_cache .ropeproject # Will be created from script/split_tests.py -pytest_buckets.txt \ No newline at end of file +# pytest_buckets.txt \ No newline at end of file diff --git a/pytest_buckets.txt b/pytest_buckets.txt new file mode 100644 index 00000000000..c2e49b8c417 --- /dev/null +++ b/pytest_buckets.txt @@ -0,0 +1,4 @@ + + + +tests/components/cloud tests/pylint tests/components/habitica tests/components/netatmo tests/components/unifi tests/components/blebox tests/components/tts tests/components/bthome tests/components/energy tests/components/bmw_connected_drive tests/components/bang_olufsen tests/components/utility_meter tests/components/spotify tests/components/roborock tests/components/yale tests/components/mysensors tests/components/rflink tests/components/zeroconf tests/components/wiz tests/components/energyzero tests/components/dhcp tests/components/nextdns tests/components/fronius tests/components/androidtv_remote tests/components/lutron_caseta tests/components/usb tests/components/scrape tests/components/lovelace tests/components/matrix tests/components/wallbox tests/components/konnected tests/components/coolmaster tests/components/transmission tests/components/anthropic tests/components/bayesian tests/components/schedule tests/components/upnp tests/components/fibaro tests/components/ista_ecotrend tests/components/tankerkoenig tests/components/greeneye_monitor tests/components/sonarr tests/components/mystrom tests/components/derivative tests/components/repairs tests/components/google_translate tests/components/nina tests/components/chacon_dio tests/components/kostal_plenticore tests/components/dlink tests/components/icloud tests/components/vlc_telnet tests/components/osoenergy tests/components/aseko_pool_live tests/components/energenie_power_sockets tests/components/oralb tests/components/trafikverket_ferry tests/components/netgear_lte tests/components/watttime tests/components/enocean tests/components/plant tests/components/airnow tests/components/evil_genius_labs tests/components/landisgyr_heat_meter tests/components/palazzetti tests/components/zerproc tests/components/openexchangerates tests/components/smtp tests/components/apsystems tests/components/cpuspeed tests/components/notion tests/components/velbus tests/components/apprise tests/components/ialarm tests/components/ovo_energy tests/components/agent_dvr tests/components/file_upload tests/components/ld2410_ble tests/components/sanix tests/components/yandex_transport tests/components/lutron tests/components/ridwell tests/components/traccar tests/components/brottsplatskartan tests/components/econet tests/components/hko tests/components/progettihwsw tests/components/aprilaire tests/components/iss tests/components/mythicbeastsdns tests/components/aftership tests/components/hardware tests/components/pvpc_hourly_pricing tests/components/transport_nsw tests/components/image_upload tests/components/qnap tests/components/twilio/test_init.py diff --git a/tests/components/conftest.py b/tests/components/conftest.py index 42944a48022..08bd16d1f7b 100644 --- a/tests/components/conftest.py +++ b/tests/components/conftest.py @@ -777,9 +777,6 @@ async def check_translations( f"Unused ignore translations: {', '.join(unused_ignore)}. " "Please remove them from the ignore_translations fixture." ) - for key, description in translation_errors.items(): - if key.startswith("component.cloud.issues."): - # cloud tests are flaky - continue + for description in translation_errors.values(): if description not in {"used", "unused"}: pytest.fail(description)