fix: try to fix scoro tests

This commit is contained in:
GitBluub
2023-09-21 00:17:02 +02:00
parent cd2e119dc6
commit e82a6b1dd6
2 changed files with 12 additions and 7 deletions

View File

@@ -26,11 +26,16 @@ from mido import MidiFile
import uuid
game_uuid = uuid.uuid4()
logname = f"/logs/{game_uuid}.log"
Path("/logs").mkdir(parents=True, exist_ok=True)
Path(logname).touch(exist_ok=True)
logging.basicConfig(filename=logname,
filemode='a', level=logging.DEBUG)
testing = os.environ.get("SCORO_TEST")
if not testing:
logname = f"/logs/{game_uuid}.log"
Path("/logs").mkdir(parents=True, exist_ok=True)
Path(logname).touch(exist_ok=True)
logging.basicConfig(filename=logname,
filemode='a', level=logging.DEBUG)
'''
Logging to loki directly

View File

@@ -10,7 +10,7 @@ TESTS_SUCCESS=0
TESTS_FAILED=0
function test {
cat $1/input | BACK_URL="http://localhost:3000" MUSICS_FOLDER="../../assets/musics/" python3 ../main.py 1> /tmp/scorometer_res 2> /tmp/scorometer_log
cat $1/input | BACK_URL="http://localhost:3000" MUSICS_FOLDER="../../assets/musics/" SCORO_TEST=true python3 ../main.py 1> /tmp/scorometer_res 2> /tmp/scorometer_log
TESTS_DONE=$((TESTS_DONE + 1))
if [ -n "$SCOROMETER_AUTOFIX" ]; then
cat /tmp/scorometer_res > $1/output
@@ -36,7 +36,7 @@ then
done
exit $TESTS_FAILED
else
cat $1/input | BACK_URL="http://localhost:3000" MUSICS_FOLDER="../../assets/musics/" python3 ../main.py 1> /tmp/scorometer_res 2> /tmp/scorometer_log
cat $1/input | SCORO_TEST=true BACK_URL="http://localhost:3000" MUSICS_FOLDER="../../assets/musics/" python3 ../main.py 1> /tmp/scorometer_res 2> /tmp/scorometer_log
echo "=========== CURRENT OUTPUT ==========="
cat /tmp/scorometer_res
echo "======================================"