diff --git a/.github/workflows/full-test.yml b/.github/workflows/full-test.yml index e3e6034b..c00b1853 100644 --- a/.github/workflows/full-test.yml +++ b/.github/workflows/full-test.yml @@ -15,7 +15,7 @@ jobs: vers: [ {pt_ver: "1.6.0", tv_ver: "0.7.0"}, {pt_ver: "1.7.0", tv_ver: "0.8.1"}, {pt_ver: "1.8.0", tv_ver: "0.9.0"}, {pt_ver: "1.9.0", tv_ver: "0.10.0"}, {pt_ver: "1.10.0", tv_ver: "0.11.1"}, {pt_ver: "1.11.0", tv_ver: "0.12.0"}, {pt_ver: "1.12.0", tv_ver: "0.13.0"} ] include: - os: macos-latest - vers: + vers: pt_ver: latest tv_ver: latest defaults: @@ -54,7 +54,7 @@ jobs: if [[ "$TORCHVISION_VER" == "latest" && "$PYTORCH_VER" == "latest" ]]; then conda install pytorch torchvision cpuonly pillow=6 -c pytorch elif [[ "$TORCHVISION_VER" == "0.9."* || "$TORCHVISION_VER" == "0.10."* ]]; then - conda install pillow=6 -c conda-forge + conda install pillow=6 -c conda-forge conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly -c pytorch else conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly pillow=6 -c pytorch @@ -83,4 +83,4 @@ jobs: - name: Run tests run: | source activate.sh - pytest tests -v + python tests/test_run.py diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 399c2c0d..0b52e731 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -19,7 +19,7 @@ jobs: vers: [ {pt_ver: "1.6.0", tv_ver: "0.7.0"}, {pt_ver: "latest", tv_ver: "latest"} ] include: - os: macos-latest - vers: + vers: pt_ver: latest tv_ver: latest defaults: @@ -48,7 +48,7 @@ jobs: if [[ "$TORCHVISION_VER" == "latest" && "$PYTORCH_VER" == "latest" ]]; then conda install pytorch torchvision cpuonly pillow=6 -c pytorch elif [[ "$TORCHVISION_VER" == "0.9."* || "$TORCHVISION_VER" == "0.10."* ]]; then - conda install pillow=6 -c conda-forge + conda install pillow=6 -c conda-forge conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly -c pytorch else conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly pillow=6 -c pytorch diff --git a/tests/test_run.py b/tests/test_run.py new file mode 100644 index 00000000..b4969390 --- /dev/null +++ b/tests/test_run.py @@ -0,0 +1,29 @@ +import subprocess +import sys + +import glob + +# Function to run a test file +def run_test(file): + try: + subprocess.run(["pytest", "-v", file], check=True) + return True + except subprocess.CalledProcessError: + return False + + +if __name__ == "__main__": + # List of test files to run + test_files = glob.glob('tests/*_test.py', recursive=True) + + print("Test files:") + for file in test_files: + print(f" - {file}") + + pass_flag = True + for test_file in test_files: + passed = run_test(test_file) + pass_flag = pass_flag and passed + + if not pass_flag: + sys.exit(1)