chore(ci): forward profile to shortint and integer test scripts

This commit is contained in:
Arthur Meyre
2023-07-07 10:03:57 +02:00
parent 4b174d552a
commit 3cfee104cb
3 changed files with 37 additions and 18 deletions

View File

@@ -8,12 +8,14 @@ function usage() {
echo "--help Print this message"
echo "--rust-toolchain The toolchain to run the tests with default: stable"
echo "--multi-bit Run multi-bit tests only: default off"
echo "--cargo-profile The cargo profile used to build tests"
echo
}
RUST_TOOLCHAIN="+stable"
multi_bit=""
not_multi_bit="_multi_bit"
cargo_profile="release"
while [ -n "$1" ]
do
@@ -33,6 +35,11 @@ do
not_multi_bit=""
;;
"--cargo-profile" )
shift
cargo_profile="$1"
;;
*)
echo "Unknown param : $1"
exit 1
@@ -94,7 +101,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
cargo "${RUST_TOOLCHAIN}" nextest run \
--tests \
--release \
--cargo-profile "${cargo_profile}" \
--package tfhe \
--profile ci \
--features="${ARCH_FEATURE}",integer,internal-keycache \
@@ -103,11 +110,11 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
if [[ "${multi_bit}" == "" ]]; then
cargo "${RUST_TOOLCHAIN}" test \
--release \
--profile "${cargo_profile}" \
--package tfhe \
--features="${ARCH_FEATURE}",integer,internal-keycache \
--doc \
integer::
-- integer::
fi
else
if [[ "${FAST_TESTS}" != TRUE ]]; then
@@ -138,7 +145,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
num_threads=$((num_cpu_threads * 2 / 3))
cargo "${RUST_TOOLCHAIN}" nextest run \
--tests \
--release \
--cargo-profile "${cargo_profile}" \
--package tfhe \
--profile ci \
--features="${ARCH_FEATURE}",integer,internal-keycache \
@@ -147,11 +154,11 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
if [[ "${multi_bit}" == "" ]]; then
cargo "${RUST_TOOLCHAIN}" test \
--release \
--profile "${cargo_profile}" \
--package tfhe \
--features="${ARCH_FEATURE}",integer,internal-keycache \
--doc \
integer:: -- --test-threads="$(${nproc_bin})"
-- --test-threads="$(${nproc_bin})" integer::
fi
fi

View File

@@ -8,11 +8,13 @@ function usage() {
echo "--help Print this message"
echo "--rust-toolchain The toolchain to run the tests with default: stable"
echo "--multi-bit Run multi-bit tests only: default off"
echo "--cargo-profile The cargo profile used to build tests"
echo
}
RUST_TOOLCHAIN="+stable"
multi_bit=""
cargo_profile="release"
while [ -n "$1" ]
do
@@ -31,6 +33,11 @@ do
multi_bit="_multi_bit"
;;
"--cargo-profile" )
shift
cargo_profile="$1"
;;
*)
echo "Unknown param : $1"
exit 1
@@ -102,7 +109,7 @@ and not test(~smart_add_and_mul)""" # This test is too slow
# Run tests only no examples or benches with small params and more threads
cargo "${RUST_TOOLCHAIN}" nextest run \
--tests \
--release \
--cargo-profile "${cargo_profile}" \
--package tfhe \
--profile ci \
--features="${ARCH_FEATURE}",shortint,internal-keycache \
@@ -119,7 +126,7 @@ and not test(~smart_add_and_mul)"""
# Run tests only no examples or benches with big params and less threads
cargo "${RUST_TOOLCHAIN}" nextest run \
--tests \
--release \
--cargo-profile "${cargo_profile}" \
--package tfhe \
--profile ci \
--features="${ARCH_FEATURE}",shortint,internal-keycache \
@@ -128,11 +135,11 @@ and not test(~smart_add_and_mul)"""
if [[ "${multi_bit}" == "" ]]; then
cargo "${RUST_TOOLCHAIN}" test \
--release \
--profile "${cargo_profile}" \
--package tfhe \
--features="${ARCH_FEATURE}",shortint,internal-keycache \
--doc \
shortint::
-- shortint::
fi
fi
else
@@ -167,7 +174,7 @@ and not test(~smart_add_and_mul)""" # This test is too slow
# Run tests only no examples or benches with small params and more threads
cargo "${RUST_TOOLCHAIN}" nextest run \
--tests \
--release \
--cargo-profile "${cargo_profile}" \
--package tfhe \
--profile ci \
--features="${ARCH_FEATURE}",shortint,internal-keycache \
@@ -176,11 +183,11 @@ and not test(~smart_add_and_mul)""" # This test is too slow
if [[ "${multi_bit}" == "" ]]; then
cargo "${RUST_TOOLCHAIN}" test \
--release \
--profile "${cargo_profile}" \
--package tfhe \
--features="${ARCH_FEATURE}",shortint,internal-keycache \
--doc \
shortint:: -- --test-threads="$(${nproc_bin})"
-- --test-threads="$(${nproc_bin})" shortint::
fi
fi