From d323e150a7be867f68d5025f815c1bb568bfc988 Mon Sep 17 00:00:00 2001 From: Martin Medler Date: Wed, 31 Jul 2024 21:26:37 +0200 Subject: [PATCH] Use .bazelignore to allow testing '//...' We did not do so in the past due to how mypy discovered Python files with Python in the past. Now that we use mypy without Bazel via pre-commit this restriction no longer applies. We prefer maintaining a .bazelignore file instead of a detailed test command. This prevents us missing tests. --- .bazelignore | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 2 +- scripts/unit_tests.sh | 5 ----- test_basic.sh | 2 +- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 .bazelignore delete mode 100755 scripts/unit_tests.sh diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 0000000..eea57ef --- /dev/null +++ b/.bazelignore @@ -0,0 +1,36 @@ +examples +examples/basic_usage +examples/ignoring_includes +examples/recursion +examples/rule_using_dwyu +examples/skipping_targets +examples/support +examples/target_mapping + +test/apply_fixes/missing_dependency +test/apply_fixes/needlessly_public_dependency +test/apply_fixes/tool_cli +test/apply_fixes/unused_dependency + +test/aspect +test/aspect/alias +test/aspect/complex_includes +test/aspect/defines +test/aspect/external_repo +test/aspect/generated_code +test/aspect/ignore_includes +test/aspect/implementation_deps +test/aspect/includes +test/aspect/platforms +test/aspect/recursion +test/aspect/relative_includes +test/aspect/rule_using_aspect +test/aspect/shared_library +test/aspect/skip_external_targets +test/aspect/skip_tags +test/aspect/target_mapping +test/aspect/tree_artifact +test/aspect/unused_dep +test/aspect/using_transitive_dep +test/aspect/valid +test/aspect/virtual_includes diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db41773..b754281 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Unit tests - run: ./scripts/unit_tests.sh + run: bazel test //... - name: Build aspect integration tests run: ./scripts/build_aspect_tests.sh - name: Build examples diff --git a/scripts/unit_tests.sh b/scripts/unit_tests.sh deleted file mode 100755 index fcab4ff..0000000 --- a/scripts/unit_tests.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -bazel test -- //src/... //scripts/... //test/aspect:all //third_party/... diff --git a/test_basic.sh b/test_basic.sh index ad16a34..725a6c4 100755 --- a/test_basic.sh +++ b/test_basic.sh @@ -11,7 +11,7 @@ poetry run pre-commit run --all-files echo "" echo "Execute unit tests" echo "" -./scripts/unit_tests.sh +bazel test //... echo "" echo "Build aspect integration tests"