From b515d81b7e1e12ffde918932b232a3e1dabcd272 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Thu, 14 Dec 2023 16:23:14 -0800 Subject: [PATCH] unit test --- .github/workflows/_all_ci.yml | 3 ++- scripts/check_imports.py | 22 ---------------------- templates/pirate-speak/Makefile | 5 +---- 3 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 scripts/check_imports.py diff --git a/.github/workflows/_all_ci.yml b/.github/workflows/_all_ci.yml index 8c3c12ed765..48ff0bdf81d 100644 --- a/.github/workflows/_all_ci.yml +++ b/.github/workflows/_all_ci.yml @@ -55,12 +55,14 @@ jobs: secrets: inherit dependencies: + if: ${{ ! startsWith(inputs.working-directory, 'templates/') }} uses: ./.github/workflows/_dependencies.yml with: working-directory: ${{ inputs.working-directory }} secrets: inherit extended-tests: + if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') && ! startsWith(inputs.working-directory, 'templates/') }} runs-on: ubuntu-latest strategy: matrix: @@ -73,7 +75,6 @@ jobs: defaults: run: working-directory: ${{ inputs.working-directory }} - if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') && ! startsWith(inputs.working-directory, 'templates/') }} steps: - uses: actions/checkout@v4 diff --git a/scripts/check_imports.py b/scripts/check_imports.py deleted file mode 100644 index 462ab97ae2e..00000000000 --- a/scripts/check_imports.py +++ /dev/null @@ -1,22 +0,0 @@ -import random -import string -import sys -import traceback -from importlib.machinery import SourceFileLoader - -if __name__ == "__main__": - files = sys.argv[1:] - has_failure = False - for file in files: - try: - module_name = "".join( - random.choice(string.ascii_letters) for _ in range(20) - ) - SourceFileLoader(module_name, file).load_module() - except Exception: - has_failure = True - print(file) - traceback.print_exc() - print() - - sys.exit(1 if has_failure else 0) diff --git a/templates/pirate-speak/Makefile b/templates/pirate-speak/Makefile index 9a266324aeb..5dbf0f461f7 100644 --- a/templates/pirate-speak/Makefile +++ b/templates/pirate-speak/Makefile @@ -4,7 +4,7 @@ all: help # Define a variable for the test file path. -TEST_FILE ?= tests/unit_tests/ +TEST_FILE ?= tests/ test: poetry run pytest $(TEST_FILE) @@ -33,9 +33,6 @@ spell_check: spell_fix: poetry run codespell --toml pyproject.toml -w -check_imports: $(shell find pirate_speak -name '*.py') - poetry run python ../../scripts/check_imports.py $^ - ###################### # HELP ######################