diff --git a/.github/workflows/commit-tests.yml b/.github/workflows/commit-tests.yml index f04148dff521a..aac67e4b71b29 100644 --- a/.github/workflows/commit-tests.yml +++ b/.github/workflows/commit-tests.yml @@ -24,8 +24,13 @@ jobs: id: fetch_changes run: | cd ivy - git fetch origin main - git diff origin/main HEAD --output="commit-diff.txt" + if [ "${{ github.event_name }}" == "pull_request" ]; then + git fetch origin main + git diff origin/main HEAD --output="commit-diff.txt" + else + git diff HEAD^ HEAD --output="commit-diff.txt" + fi + - name: Install ivy and fetch binaries run: | diff --git a/scripts/run_tests_from_diff.py b/scripts/run_tests_from_diff.py index 52111683cd4a5..5a00f99c1ab69 100644 --- a/scripts/run_tests_from_diff.py +++ b/scripts/run_tests_from_diff.py @@ -69,7 +69,7 @@ for test_path in set(test_paths): pytest_command = ( - f"pytest {file_path} -p no:warnings --tb=short --backend jax,tensorflow,torch" + f"pytest {test_path} -p no:warnings --tb=short --backend jax,tensorflow,torch" ) print(f"Running test command: {pytest_command}") result = subprocess.run(pytest_command, shell=True)