diff --git a/.github/check_for_changes.py b/.github/check_for_changes.py new file mode 100644 index 000000000..01a77d3df --- /dev/null +++ b/.github/check_for_changes.py @@ -0,0 +1,10 @@ +import subprocess + +output = subprocess.run(["git", "status", "--porcelain"], capture_output=True, check=True).stdout + +if output == b"": + # No changes + exit(0) + +print(output) +exit(1) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 89fd9c560..dc3875caf 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -61,9 +61,6 @@ jobs: - name: Run pylint run: poetry run pylint openapi_python_client - - name: Regenerate Golden Record - run: poetry run task regen_e2e - - name: Run pytest run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py --basetemp=tests/tmp env: @@ -77,18 +74,12 @@ jobs: with: files: ./coverage.xml - - uses: stefanzweifel/git-auto-commit-action@v4 - if: runner.os == 'Linux' - with: - commit_message: "chore: Regenerate E2E Golden Record" - file_pattern: end_to_end_tests/golden-record end_to_end_tests/custom-templates-golden-record - integration: name: Integration Tests runs-on: ubuntu-latest services: openapi-test-server: - image: ghcr.io/openapi-generators/openapi-test-server:latest + image: ghcr.io/openapi-generators/openapi-test-server:0.0.1 ports: - "3000:3000" steps: @@ -116,6 +107,8 @@ jobs: - name: Regenerate Integration Client run: | poetry run openapi-python-client update --url http://localhost:3000/openapi.json --config integration-tests-config.yaml + - name: Check for any file changes + run: python .github/check_for_changes.py - name: Cache Generated Client Dependencies uses: actions/cache@v2 with: @@ -133,6 +126,3 @@ jobs: run: | cd integration-tests poetry run pytest - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "chore: Regenerate Integration Client" diff --git a/integration-tests/tests/conftest.py b/integration-tests/tests/conftest.py index aebbecfc5..9cdd679fa 100644 --- a/integration-tests/tests/conftest.py +++ b/integration-tests/tests/conftest.py @@ -1,4 +1,5 @@ import pytest + from integration_tests.client import Client diff --git a/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py b/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py index 39f87d00d..2403ca417 100644 --- a/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py +++ b/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py @@ -18,7 +18,7 @@ def test(client: Client) -> None: ) parsed = response.parsed - assert parsed is not None, f"{response.status_code}: {response.content}" + assert parsed is not None, f"{response.status_code}: {response.content!r}" assert isinstance( parsed, PostParametersHeaderResponse200, diff --git a/pyproject.toml b/pyproject.toml index dd9bd566c..976c13666 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,7 +101,7 @@ exclude = ''' [tool.isort] line_length = 120 profile = "black" -skip = [".venv", "tests/test_templates"] +skip = [".venv", "tests/test_templates", "integration-tests"] [tool.coverage.run] omit = ["openapi_python_client/templates/*"]