diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ba2ac0a4..a8812c2d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -151,7 +151,7 @@ jobs: - name: Run tests on documentation examples env: TERRAFORM: ${{ matrix.flavour }} - run: pytest -vv ${{ matrix.flavour == 'terraform' && '-n4' || '-n4' }} --tb=line --junit-xml=test-results-raw.xml -k modules/ tests/examples + run: pytest -vv ${{ matrix.flavour == 'terraform' && '-n4' || '-n4' }} --tb=line --junit-xml=test-results-raw.xml -k "terraform: and modules/" tests/examples - name: Create report uses: ./.github/actions/post-fabric-tests @@ -238,3 +238,25 @@ jobs: if: always() with: MODULE: FAST + + test-schemas: + runs-on: ubuntu-latest + needs: setup-tf-providers + steps: + - uses: actions/checkout@v4 + + - name: Call composite action fabric-tests + uses: ./.github/actions/fabric-tests + with: + PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + TERRAFORM_VERSION: ${{ env.DEFAULT_TERRAFORM_VERSION }} + TERRAFORM_FLAVOUR: ${{ env.DEFAULT_TERRAFORM_FLAVOUR }} + + - name: Run schema tests + run: pytest -vv --tb=line --junit-xml=test-results-raw.xml "(tests and schemas) or (fast and schema) or (examples and yaml)" + + - name: Create report + uses: ./.github/actions/post-fabric-tests + if: always() + with: + MODULE: Schemas diff --git a/tests/collectors.py b/tests/collectors.py index 124cfc396..1e4932058 100644 --- a/tests/collectors.py +++ b/tests/collectors.py @@ -153,7 +153,7 @@ class FastDataFile(pytest.File): raise Exception(f'Cannot read test spec {self.path}: {e}') schema_path = self._get_yaml_schema(raw) - if schema_path is None: + if schema_path is None or content is None: return print(f"---- {schema_path}")