2023-07-25 07:21:11 +00:00
|
|
|
#!/bin/bash
|
2021-02-05 15:56:27 +00:00
|
|
|
|
2023-07-25 07:21:11 +00:00
|
|
|
source qa-common.sh
|
2021-02-05 15:56:27 +00:00
|
|
|
|
|
|
|
MIN_EXO_TODO=$(($MIN_LVL_TODO - 1))
|
2023-07-25 07:21:11 +00:00
|
|
|
MAX_EXO_TODO=$(($MAX_LVL_TODO))
|
2021-02-05 15:56:27 +00:00
|
|
|
|
2023-07-25 07:21:11 +00:00
|
|
|
curl -s http://${HOST_FICADMIN}/api/teams | jq -r '.[] | [(.id | tostring), " ", .name] | add' | while read TEAMID TEAMSTR
|
2021-02-05 15:56:27 +00:00
|
|
|
do
|
2023-07-25 07:21:11 +00:00
|
|
|
if echo $TEAMSTR | grep "${TEAM_PREFIX}" > /dev/null 2> /dev/null
|
2021-02-05 15:56:27 +00:00
|
|
|
then
|
2023-07-25 07:21:11 +00:00
|
|
|
GRPFIC=$(echo $TEAMSTR | sed -r "s/${TEAM_PREFIX} //")
|
2021-02-05 15:56:27 +00:00
|
|
|
|
2023-07-25 07:21:11 +00:00
|
|
|
THEMES_TO_TESTS=$(curl -s http://${HOST_FICADMIN}/api/themes | jq -r '.[] | [(.id | tostring), " ", (.path | split("-") | .[0])] | add' | grep -v " grp$GRPFIC" | shuf | head -n $NB_THEMES_TODO | cut -d " " -f 1 | xargs | sed 's/^/"/;s/ /","/g;s/$/"/')
|
2021-02-05 15:56:27 +00:00
|
|
|
|
2023-07-25 07:21:11 +00:00
|
|
|
curl -s http://${HOST_FICADMIN}/api/themes.json | jq -r '.['$THEMES_TO_TESTS'] | .exercices['$MIN_EXO_TODO:$MAX_EXO_TODO'] | .[].id' | while read EXID
|
2021-02-05 15:56:27 +00:00
|
|
|
do
|
2023-07-25 07:21:11 +00:00
|
|
|
curl -X POST -d @- -H "X-FIC-Team: ${QA_ADMIN}" http://${HOST_FICQA}/api/qa_work.json <<EOF
|
2021-02-05 15:56:27 +00:00
|
|
|
{"id_team": $TEAMID, "id_exercice": $EXID}
|
|
|
|
EOF
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|