Repository: hacs/integration (branch: rename-util.url-functions)
Commit date: 2023-12-26T13:07:41Z

Workflow file: .github/workflows/pytest.yml (Test)
name: Test

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

concurrency:
  group: test-${{ github.ref }}
  cancel-in-progress: true

jobs:
  run:
    name: With pytest for Python ${{ matrix.python-version }}
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    strategy:
      matrix:
        python-version: ["3.11"]
    steps:
      - name: 📥 Checkout the repository
        uses: actions/checkout@v4.1.1

      - name: 🛠️ Set up Python
        uses: actions/setup-python@v4.7.1
        id: python
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
          cache-dependency-path: |
            requirements_base.txt
            requirements_test.txt

      - name: 📦 Install requirements
        run: |
          scripts/install/frontend
          scripts/install/pip_packages --requirement requirements_test.txt

      - name: 🏃 Run tests
        env:
          PYTEST: true
        run: |
          python3 -m pytest

      - name: 📤 Upload coverage to Codecov
        if: ${{ matrix.python-version == '3.11' }}
        run: |
          scripts/coverage
          curl -sfSL https://codecov.io/bash | bash -

  legacy:
    name: With pytest with Home Assistant 2023.6.0
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
      - name: 📥 Checkout the repository
        uses: actions/checkout@v4.1.1

      - name: 🛠️ Set up Python 3.11
        uses: actions/setup-python@v4.7.1
        with:
          python-version: "3.11"
          cache: 'pip'
          cache-dependency-path: |
            requirements_base.txt
            requirements_test.txt

      - name: 📦 Install dependencies
        run: |
          scripts/install/pip_packages --requirement requirements_test.txt
          scripts/install/core
          scripts/install/frontend

      - name: 🏃 Run tests
        env:
          PYTEST: true
        run: |
          python3 -m pytest

  core_dev:
    name: With pytest with Home Assistant dev
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
      - name: 📥 Checkout the repository
        uses: actions/checkout@v4.1.1

      - name: 🛠️ Set up Python 3.11
        uses: actions/setup-python@v4.7.1
        with:
          python-version: "3.11"
          cache: 'pip'
          cache-dependency-path: |
            requirements_base.txt
            requirements_test.txt

      - name: 📦 Install dependencies
        run: |
          scripts/install/pip_packages --requirement requirements_test.txt
          scripts/install/core_dev
          scripts/install/frontend

      - name: 🏃 Run tests
        env:
          PYTEST: true
        run: |
          python3 -m pytest

env:
  PIP_INDEX_URL: http://localhost:8629/2023-12-26
  UV_INDEX_URL: http://localhost:8629/2023-12-26


Failed build logs:
step_name: With pytest with Home Assistant dev/5_🏃 Run tests.txt
log: ##[group]Run python3 -m pytest
[36;1mpython3 -m pytest[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.11.7/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib
  PYTEST: true
##[endgroup]
============================= test session starts ==============================
platform linux -- Python 3.11.7, pytest-7.4.3, pluggy-1.3.0 -- /opt/hostedtoolcache/Python/3.11.7/x64/bin/python3
cachedir: .pytest_cache
rootdir: /home/runner/work/integration/integration
configfile: pyproject.toml
testpaths: tests
plugins: asyncio-0.21.1, socket-0.6.0, anyio-4.2.0, cov-4.1.0, aresponses-2.1.6
asyncio: mode=Mode.STRICT
collecting ... collected 173 items

tests/test_configuration_schema.py::test_combined PASSED                 [  0%]
tests/test_diagnostics.py::test_diagnostics ERROR                        [  1%]

==================================== ERRORS ====================================
______________________ ERROR at setup of test_diagnostics ______________________

    @pytest.fixture
    def config_entry() -> ConfigEntry:
        """Fixture for a config entry."""
>       yield ConfigEntry(
            version=1,
            domain=DOMAIN,
            title="",
            data={CONF_TOKEN: TOKEN},
            source="user",
            options={},
            unique_id="12345",
        )
E       TypeError: ConfigEntry.__init__() missing 1 required keyword-only argument: 'minor_version'


tests/conftest.py:220: TypeError
---------------------------- Captured stderr setup -----------------------------
:asyncio:Using selector: EpollSelector
:asyncio:Using selector: EpollSelector
:homeassistant.util.json:JSON file not found: /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/http.auth
:homeassistant.core:Bus:Handling <Event user_added[L]: user_id=2e9b6ca9032e44228f2d7841b1e265d1>
:homeassistant.helpers.storage:Writing data for http.auth to /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/http.auth
:homeassistant.util.json:JSON file not found: /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/core.network
:homeassistant.components.network.network:Adapters: [{'name': 'lo', 'index': 1, 'enabled': False, 'auto': False, 'default': False, 'ipv4': [{'address': '127.0.0.1', 'network_prefix': 8}], 'ipv6': [{'address': '::1', 'flowinfo': 0, 'scope_id': 0, 'network_prefix': 128}]}, {'name': 'eth0', 'index': 2, 'enabled': True, 'auto': True, 'default': True, 'ipv4': [{'address': '10.1.0.21', 'network_prefix': 16}], 'ipv6': [{'address': 'fe80::222:48ff:fe1f:56d', 'flowinfo': 0, 'scope_id': 2, 'network_prefix': 64}]}, {'name': 'docker0', 'index': 3, 'enabled': False, 'auto': False, 'default': False, 'ipv4': [{'address': '172.17.0.1', 'network_prefix': 16}], 'ipv6': []}]
:homeassistant.loader:Loaded hacs from custom_components.hacs
------------------------------ Captured log setup ------------------------------
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    homeassistant.util.json:json.py:80 JSON file not found: /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/http.auth
DEBUG    homeassistant.core:core.py:1156 Bus:Handling <Event user_added[L]: user_id=2e9b6ca9032e44228f2d7841b1e265d1>
DEBUG    homeassistant.helpers.storage:storage.py:363 Writing data for http.auth to /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/http.auth
DEBUG    homeassistant.util.json:json.py:80 JSON file not found: /tmp/pytest-of-runner/pytest-0/test_diagnostics0/.storage/core.network
DEBUG    homeassistant.components.network.network:network.py:31 Adapters: [{'name': 'lo', 'index': 1, 'enabled': False, 'auto': False, 'default': False, 'ipv4': [{'address': '127.0.0.1', 'network_prefix': 8}], 'ipv6': [{'address': '::1', 'flowinfo': 0, 'scope_id': 0, 'network_prefix': 128}]}, {'name': 'eth0', 'index': 2, 'enabled': True, 'auto': True, 'default': True, 'ipv4': [{'address': '10.1.0.21', 'network_prefix': 16}], 'ipv6': [{'address': 'fe80::222:48ff:fe1f:56d', 'flowinfo': 0, 'scope_id': 2, 'network_prefix': 64}]}, {'name': 'docker0', 'index': 3, 'enabled': False, 'auto': False, 'default': False, 'ipv4': [{'address': '172.17.0.1', 'network_prefix': 16}], 'ipv6': []}]
INFO     homeassistant.loader:loader.py:651 Loaded hacs from custom_components.hacs

---------- coverage: platform linux, python 3.11.7-final-0 -----------
Coverage XML written to file coverage.xml

!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
========================== 1 passed, 1 error in 0.85s ==========================
##[error]Process completed with exit code 1.


Changed files:
tests/conftest.py

Fix diff:
diff --git a/tests/conftest.py b/tests/conftest.py
index e329498b..8f1dae36 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -217,15 +217,20 @@ def repository_netdaemon(hacs):
 @pytest.fixture
 def config_entry() -> ConfigEntry:
     """Fixture for a config entry."""
-    yield ConfigEntry(
-        version=1,
-        domain=DOMAIN,
-        title="",
-        data={CONF_TOKEN: TOKEN},
-        source="user",
-        options={},
-        unique_id="12345",
-    )
+    args = {
+        "version": 1,
+        "domain": DOMAIN,
+        "title": "",
+        "data": {CONF_TOKEN: TOKEN},
+        "source": "user",
+        "options": {},
+        "unique_id": "12345",
+    }
+    # Core 2024.1 added minor_version
+    try:
+        return ConfigEntry(**{**args, "minor_version": 0})
+    except TypeError:
+        return ConfigEntry(**args)
 
 
 @pytest_asyncio.fixture