Skip to content

Commit

Permalink
Show elapsed time for unit/coverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw committed Jul 14, 2024
1 parent 87fbd57 commit 0107d39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ test_custom()
test_unit()
{
echo "Testing Numba JIT Compiled Functions"
SECONDS=0
if [[ ${#custom_testfiles[@]} -eq "0" ]]; then
for testfile in tests/test_*.py
do
Expand All @@ -209,6 +210,8 @@ test_unit()
check_errs $?
done
fi
duration=$SECONDS
echo "Elapsed Time: $((duration / 60)) minutes and $((duration % 60)) seconds"
}

test_coverage()
Expand All @@ -226,6 +229,7 @@ test_coverage()

# We always attempt to test everything but we may ignore things (ray, helper scripts) when we generate the coverage report

SECONDS=0
if [[ ${#custom_testfiles[@]} -eq "0" ]]; then
# Execute all tests
for testfile in tests/test_*.py;
Expand All @@ -241,6 +245,8 @@ test_coverage()
check_errs $?
done
fi
duration=$SECONDS
echo "Elapsed Time: $((duration / 60)) minutes and $((duration % 60)) seconds"
show_coverage_report
}

Expand Down

0 comments on commit 0107d39

Please sign in to comment.