From 2eb4a50d4d03d12c7feceaa8135804e1910d88f8 Mon Sep 17 00:00:00 2001 From: Zwelf Date: Sun, 21 Apr 2024 23:24:16 +0200 Subject: [PATCH] Add check for correct finish time in integration_test.sh ALso exclude coverage.map from twmap-checker due to using tele checkpoints without matching tele checkpoints to test physics. Disable exact checks on valgrind. Only require at least one finish. --- .github/workflows/style.yml | 2 +- data/maps/coverage.map | Bin 2319 -> 3791 bytes scripts/integration_test.sh | 33 ++++++++++++++++++++------------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index cdd21ec04..65faae305 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -77,7 +77,7 @@ jobs: run: scripts/check_unused_header_files.py - name: Check maps run: | - findings=$(find data -type f -name '*.map' -print0 | xargs -0 ~/.cargo/bin/twmap-check-ddnet 2>&1 | \ + findings=$(find data -type f -name '*.map' ! -wholename 'data/maps/coverage.map' -print0 | xargs -0 ~/.cargo/bin/twmap-check-ddnet 2>&1 | \ grep -v -E "\"data/maps/(ctf|dm).*\.map\": Time cps are missing on the map" | \ grep -v -E "\"data/themes/.*\.map\": Time cps are missing on the map" | \ grep -v -E "\"data/maps/ctf4\.map\": Map - In Image at index 3 -> Image 'jungle_doodads_old' is not a valid external image for DDNet06" | \ diff --git a/data/maps/coverage.map b/data/maps/coverage.map index 308cde79b91f063f26bbec1c9041eeccc8b917ad..af7113ab9f9b7b6359351dfc3ae7f6b2946b3499 100644 GIT binary patch delta 2542 zcmY+G3p`X?7r@WFyvi7lDCT0KOC~b8n2}7Fj8WGsddXE+Px4A6VMg+(JmMfKNp&$- z9#N65S7IU~8bXt|@yeL-jtSqH?(h44ed~ArXRovOT5GSp*YBKtk`zAtvXx@#Vu=I* zpau;9Qz!tCf^ctQ?CxG*9f6-SYQ`hJSGjsl;-HNXsnCRV(%X~AqG zWH|p{Yq8}XC3q~TfV3MFEk_}^Tj7Ni)_spDreJQCE5-=+4a z3%0%bb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kCm`!++eY+d{07@6mt>O2!Q5|~2BNVgt@D;2F#Z?cVZLUpKy zpFTmFi5=$49Wz0uv-Zhqw|gBOYGH>%gws}kRJdJ zNW9i%g;%^jXv+$r3Ra&*Pc_xNsbaoPscks(bNZV@m8^L@?eZ0E)u@6m`d-=K;rmh$ z>RPO*uluX_M0ap*Fsc8Np-?_PS#-bT0ym?}c3d=LqB&zBt6blepZ&dP|5Xdar8^`j zX-~=*_H4N>eLdK~Tbvd8h3f7me%^TyvEtAlH!}W*gD~(jE?@j*b;15h*F%P|@GISj r!5{jb&!xHd&iywX>liYaI1$PTXcWC3&}p@OF!7Gs{f>|%IK}%P{aovG diff --git a/scripts/integration_test.sh b/scripts/integration_test.sh index 09895662d..9efde538b 100755 --- a/scripts/integration_test.sh +++ b/scripts/integration_test.sh @@ -167,7 +167,7 @@ function wait_for_fifo() { print_results exit 1 fi - sleep 1 + sleep 0.1 done } @@ -175,10 +175,10 @@ function wait_for_launch() { local fifo="$1" local baseDuration="$2" if [ "$arg_valgrind_memcheck" == "1" ]; then - wait_for_fifo "$fifo" $((40 * baseDuration)) + wait_for_fifo "$fifo" $((400 * baseDuration)) sleep $((8 * baseDuration)) else - wait_for_fifo "$fifo" $((10 * baseDuration)) + wait_for_fifo "$fifo" $((100 * baseDuration)) sleep "$baseDuration" fi } @@ -203,12 +203,11 @@ $tool ../DDNet \ $client_args connect localhost:$port" > stdout_client1.txt 2> stderr_client1.txt || fail client1 "$?" & -wait_for_launch client1.fifo 5 +wait_for_launch client1.fifo 3 echo "[*] Start demo recording" echo "record server" > server.fifo echo "record client1" > client1.fifo -sleep 1 echo "[*] Launch client 2" $tool ../DDNet \ @@ -220,6 +219,9 @@ $tool ../DDNet \ wait_for_launch client2.fifo 5 +# wait for tees to finish +sleep 15 + echo "[*] Test chat and chat commands" echo "say hello world" > client1.fifo echo "rcon_auth rcon" > client1.fifo @@ -313,20 +315,25 @@ then fi ranks="$(sqlite3 ddnet-server.sqlite < <(echo "select * from record_race;"))" -num_ranks="$(echo "$ranks" | wc -l | xargs)" +rank_time="$(echo "$ranks" | awk -F '|' '{ print "player:", $2, "time:", $4, "cps:", $6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28 }')" +expected_times="\ +player: client2 time: 1020.98 cps: 0.02 0.1 0.2 0.26 0.32 600.36 600.42 600.46 600.5 1020.54 1020.58 1020.6 1020.64 1020.66 1020.7 1020.72 1020.76 1020.78 1020.8 1020.84 1020.86 1020.88 1020.9 +player: client2 time: 1020.38 cps: 1021.34 0.02 0.04 0.04 0.06 600.08 600.1 600.12 600.12 1020.14 1020.16 1020.18 1020.2 1020.2 1020.22 1020.24 1020.26 1020.26 1020.28 1020.3 1020.3 1020.32 1020.34 +player: client1 time: 6248.56 cps: 0.42 0.5 0.0 0.66 0.92 0.02 300.18 300.46 300.76 300.88 300.98 301.02 301.04 301.06 301.08 301.18 301.38 301.66 307.34 308.08 308.1 308.14 308.44 +player: client1 time: 168300.5 cps: 0.02 0.06 0.12 15300.14 15300.18 30600.2 30600.22 45900.24 45900.26 61200.28 61200.3 76500.32 76500.34 91800.36 91800.36 107100.38 107100.4 122400.42 122400.42 137700.44 137700.45 137700.45 153000.48 +player: client2 time: 302.02 cps: 0.42 0.5 0.0 0.66 0.92 0.02 300.18 300.46 300.76 300.88 300.98 301.16 301.24 301.28 301.3 301.86 301.96 0.0 0.0 0.0 0.0 0.0 0.0" + +# require at least one rank in all cases. Exact finishes only with valgrind disabled if [ "$ranks" == "" ] then touch fail_ranks.txt echo "[-] Error: no ranks found in database" -elif [ "$num_ranks" != "1" ] +elif [ "$arg_valgrind_memcheck" != "1" ] && [ "$rank_time" != "$expected_times" ] then touch fail_ranks.txt - echo "[-] Error: expected 1 rank got $num_ranks" -elif ! echo "$ranks" | grep -q client1 -then - touch fail_ranks.txt - echo "[-] Error: expected a rank from client1 instead got:" - echo " $ranks" + echo "[-] Error: unexpected finish time" + echo " expected: $expected_times" + echo " got: $rank_time" fi for logfile in client1.log client2.log server.log