Skip to content

Commit

Permalink
chore(frontend): update cml test script to ignore all flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft committed Aug 4, 2023
1 parent 4475d6c commit 5217169
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions ci/scripts/test_cml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ CP_VERSION="current"
# Set to 1 only to debug quickly
DO_QUICK_SCRIPT_DEBUG=0

# Set to 1 to use exactly the pytest commandline of ML team. However, it's longer, since it runs
# the full test, while the one in this script exits at first problem
DO_USE_CML_PYTEST_COMMANDLINE=0
# Set to 1 to stop the CI at the first test that fails
STOP_AT_FIRST_FAIL=0

# Which python to use, to create the venv
PYTHON=python
Expand Down Expand Up @@ -75,8 +74,8 @@ do
DO_QUICK_SCRIPT_DEBUG=1
;;

"--use_cml_command_line" )
DO_USE_CML_PYTEST_COMMANDLINE=1
"--stop_at_first_fail" )
STOP_AT_FIRST_FAIL=1
;;

"--ml_branch" )
Expand Down Expand Up @@ -180,19 +179,17 @@ INSTALLED_CP=`pip freeze | grep "concrete-python"`
echo
echo "Installed Concrete-Python: ${INSTALLED_CP}"

# Launch CML pytests
# Launch CML tests with pytest (and ignore flaky ones)
# As compared to regular `make pytest`, known flaky errors from Concrete ML are simply ignored
# and coverage is disabled
# The "-x" option is added so that the run stops at the first test that fails
echo
echo "Launching CML tests"

if [ $DO_USE_CML_PYTEST_COMMANDLINE -eq 1 ]
echo "Launching CML tests (no flaky)"
if [ $STOP_AT_FIRST_FAIL -eq 1 ]
then
echo "make pytest"
make pytest
echo "make pytest_no_flaky PYTEST_OPTIONS="-x""
make pytest_no_flaky PYTEST_OPTIONS="-x"
else
# As compared to ML pytest:
# No coverage
# Stop at first error
echo "poetry run pytest -xsvv -n 4 --randomly-dont-reorganize --randomly-dont-reset-seed"
poetry run pytest -xsvv -n 4 --randomly-dont-reorganize --randomly-dont-reset-seed

echo "make pytest_no_flaky"
make pytest_no_flaky
fi

0 comments on commit 5217169

Please sign in to comment.