Skip to content

Commit

Permalink
test(frontend): add a --patch option to ML tests
Browse files Browse the repository at this point in the history
to test the removal of workarounds, or the use of new Concrete features

closes #442
  • Loading branch information
bcm-at-zama authored and BourgerieQuentin committed Aug 8, 2023
1 parent 37b3782 commit 3a884f5
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions ci/scripts/test_cml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ function usage() {
echo "About ML repository:"
echo "--ml_branch <branch> Specify the branch of ML repo (default is main)"
echo
echo "About patches to apply to ML sources/tests, to test the removal of workarounds:"
echo "--patch patch_diff_file Specify a local patch to apply. Patches are obtained by"
echo " modifying ML files, and then `git diff > patch.diff`"
echo
echo "About CP version:"
echo "--cp_version x.y.z Install the chosen version of CP"
echo "--last_nightly_cp_version Install the last nightly of CP"
echo "--use-wheel /path/to/wheel Install CP from this wheel"
echo
echo "About the tests to run"
echo "--use_cml_command_line Use exactly commandline by ML team"
echo
echo "And the other options"
echo "--quick_debug_of_the_script Do not use, unless you debug the script"
echo "--python <python_command_line> Which python to use (eg, python3.9, default is python)"
Expand Down Expand Up @@ -52,6 +53,8 @@ ML_BRANCH="main"
# Specify wheel's path if we want to install CP from wheel
WHEEL=""

PATCH=""

while [ -n "$1" ]
do
case "$1" in
Expand All @@ -70,6 +73,11 @@ do
CP_VERSION="wheel"
;;

"--patch" )
shift
PATCH="${1}"
;;

"--quick_debug_of_the_script" )
DO_QUICK_SCRIPT_DEBUG=1
;;
Expand Down Expand Up @@ -102,6 +110,12 @@ do
shift
done

# The patch is assumed to be local
if [ "$PATCH" != "" ]
then
PATCH="$PWD/$PATCH"
fi

# Directory for tests
echo
echo "Creating a temporary directory for CML tests"
Expand Down Expand Up @@ -179,6 +193,14 @@ INSTALLED_CP=`pip freeze | grep "concrete-python"`
echo
echo "Installed Concrete-Python: ${INSTALLED_CP}"

if [ "$PATCH" != "" ]
then
echo "Applying patch $PATCH"
git apply $PATCH
echo "Modifications in ML repository:"
git diff
fi

# 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
Expand Down

0 comments on commit 3a884f5

Please sign in to comment.