diff --git a/.github/workflows/validate.yml b/.github/workflows/ci.yml similarity index 57% rename from .github/workflows/validate.yml rename to .github/workflows/ci.yml index 7a2c6a1..d9d65a1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,7 @@ -name: "Validate" +name: "CI" on: workflow_dispatch: - schedule: - - cron: "0 0 * * *" push: branches: - "main" @@ -11,6 +9,9 @@ on: branches: - "main" +env: + DEFAULT_PYTHON: "3.12" + jobs: hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest name: "Hassfest Validation" @@ -35,3 +36,26 @@ jobs: category: "integration" # Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands ignore: "brands" + + tests: + runs-on: "ubuntu-latest" + name: Run tests + steps: + - name: Check out code from GitHub + uses: "actions/checkout@v4.2.1" + - name: Setup Python ${{ env.DEFAULT_PYTHON }} + uses: "actions/setup-python@v5.1.1" + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Install requirements + run: | + pip install pip + pip install -r requirements_test.txt + - name: Tests suite + run: | + pytest -p no:sugar + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.5.0 + with: + env_vars: OS,PYTHON + verbose: true diff --git a/tests/test_proxy_lib.py b/tests/test_proxy_lib.py index 6e5b766..8841651 100644 --- a/tests/test_proxy_lib.py +++ b/tests/test_proxy_lib.py @@ -201,10 +201,10 @@ async def test_headers( hass_client_no_auth: Any, ) -> None: """Test proxy headers are added and respected.""" - unauthenticated_hass_client = await hass_client_no_auth() - await register_test_view(hass, proxied_url=ProxiedURL(url=f"{local_server}ok")) + unauthenticated_hass_client = await hass_client_no_auth() + resp = await unauthenticated_hass_client.get( TEST_PROXY_URL, headers={hdrs.CONTENT_ENCODING: "foo"},