-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_in_docker.sh
62 lines (45 loc) · 1.41 KB
/
run_in_docker.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
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
PROJECTS_DIR="/app/benchmarks/"
RESULTS_DIR="/app/results/"
SCRIPTS=("install_reqs.sh" "flame_run.sh" "mutmut_run.sh" "get_results.sh")
FILES=("mutation_scores.csv" "compare_candidates.csv")
mkdir -p "$RESULTS_DIR"
# Check if a specific project name was provided as an argument
SPECIFIC_PROJECT=$1
for PROJECT_PATH in "$PROJECTS_DIR"/*; do
if [ -d "$PROJECT_PATH" ]; then
PROJECT_NAME=$(basename "$PROJECT_PATH")
# If a specific project is given, skip others
if [ -n "$SPECIFIC_PROJECT" ] && [ "$PROJECT_NAME" != "$SPECIFIC_PROJECT" ]; then
continue
fi
PROJECT_RESULTS_DIR="$RESULTS_DIR/$PROJECT_NAME"
mkdir -p "$PROJECT_RESULTS_DIR"
cd "$PROJECT_PATH" || continue
python3 -m venv venv
source venv/bin/activate
pip install /app
pip install git+https://github.com/python-mutation-testing/mutmut.git@mutation-type
pip install pandas
for SCRIPT in "${SCRIPTS[@]}"; do
if [ -f "$SCRIPT" ]; then
bash "$SCRIPT"
else
echo "Warning: $SCRIPT not found in $PROJECT_PATH"
fi
done
deactivate
for FILE in "${FILES[@]}"; do
if [ -f "$FILE" ]; then
cp "$FILE" "$PROJECT_RESULTS_DIR/"
else
echo "Warning: $FILE not found in $PROJECT_PATH"
fi
done
rm -rf venv
fi
done
pip install pandas
pip install tabulate
python /app/scripts/aggregate_results.py
echo "Script execution completed."