-
Notifications
You must be signed in to change notification settings - Fork 26
/
run_pytests.sh
50 lines (40 loc) · 1.38 KB
/
run_pytests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# This bash script will run all pytest tests within the different environments
# Define the test files that will be tested with the mlde environment, the mlde2
# environment, and both environments
declare -a both_env_tests=(
./code/validation/pytest/encode/test_encoding_generator.py
./code/validation/pytest/encode/test_sequence_loader.py
./code/validation/pytest/encode/test_support_funcs.py
)
declare -a mlde2_only_tests=(
./code/validation/pytest/encode/test_transformer_classes.py
./code/validation/pytest/zero_shot
)
declare -a mlde_only_tests=(
./code/validation/pytest/run
)
# Write a function that evaluates a set of tests
execute_tests () {
input_array=("$@")
for test_loc in "${input_array[@]}"; do
pytest "$test_loc"
done
}
# Activate the conda mlde environment
source ~/anaconda3/etc/profile.d/conda.sh
conda activate mlde
# Run pytest on the appropriate mlde only and both environments tests
execute_tests "${both_env_tests[@]}"
execute_tests "${mlde_only_tests[@]}"
# Activate the mlde2 environment
conda deactivate
conda activate mlde2
# Run pytest on the appropriate mlde2 only and both environments tests
execute_tests "${both_env_tests[@]}"
execute_tests "${mlde2_only_tests[@]}"
# Activate the deepsequence environment
conda deactivate
conda activate deep_sequence
# Run deep sequence tests
pytest deep_sequence/test_deepseq.py