Enable fortress tests in CI (#2153)

* download and cache the test save along with df

Depends on us actually putting the test save on files.dfhack.org

* run fortress tests in run-tests.py

* use google drive link for now

* make the save directory before extracting to it
develop
Myk 2022-06-02 15:50:17 -07:00 committed by GitHub
parent 206944a00d
commit ea44be9b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

@ -2,7 +2,8 @@
set -e set -e
tardest="df.tar.bz2" df_tardest="df.tar.bz2"
save_tardest="test_save.tgz"
selfmd5=$(openssl md5 < "$0") selfmd5=$(openssl md5 < "$0")
echo $selfmd5 echo $selfmd5
@ -16,40 +17,48 @@ cd "$DF_FOLDER/.."
if [ -f receipt ]; then if [ -f receipt ]; then
if [ "$selfmd5" != "$(cat receipt)" ]; then if [ "$selfmd5" != "$(cat receipt)" ]; then
echo "download-df.sh changed; removing DF" echo "download-df.sh changed; re-downloading tarballs"
rm receipt rm receipt
else else
echo "Already downloaded $DF_VERSION" echo "Already downloaded $DF_VERSION tarballs"
fi fi
fi fi
if [ ! -f receipt ]; then if [ ! -f receipt ]; then
rm -f "$tardest" rm -f "$df_tardest" "$save_tardest"
minor=$(echo "$DF_VERSION" | cut -d. -f2) minor=$(echo "$DF_VERSION" | cut -d. -f2)
patch=$(echo "$DF_VERSION" | cut -d. -f3) patch=$(echo "$DF_VERSION" | cut -d. -f3)
url="http://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2" echo "Downloading DF $DF_VERSION"
echo Downloading
while read url; do while read url; do
echo "Attempting download: ${url}" echo "Attempting download: ${url}"
if wget -v "$url" -O "$tardest"; then if wget -v "$url" -O "$df_tardest"; then
break break
fi fi
done <<URLS done <<URLS
https://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2 https://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2
https://files.dfhack.org/DF/0.${minor}.${patch}/df_${minor}_${patch}_linux.tar.bz2 https://files.dfhack.org/DF/0.${minor}.${patch}/df_${minor}_${patch}_linux.tar.bz2
URLS URLS
echo $tardest echo $df_tardest
if ! test -f "$tardest"; then if ! test -f "$df_tardest"; then
echo "DF failed to download: $tardest not found" echo "DF failed to download: $df_tardest not found"
exit 1 exit 1
fi fi
echo "Downloading test save"
#test_save_url="https://files.dfhack.org/DF/0.${minor}.${patch}/test_save.tgz"
test_save_url="https://drive.google.com/uc?export=download&id=1XvYngl-DFONiZ9SD9OC4B2Ooecu8rPFz"
if ! wget -v "$test_save_url" -O "$save_tardest"; then
echo "failed to download test save"
exit 1
fi
echo $save_tardest
fi fi
rm -rf df_linux rm -rf df_linux
mkdir df_linux mkdir -p df_linux/data/save
echo Extracting echo Extracting
tar xf "$tardest" --strip-components=1 -C df_linux tar xf "$df_tardest" --strip-components=1 -C df_linux
tar xf "$save_tardest" -C df_linux/data/save
echo Done echo Done
echo "$selfmd5" > receipt echo "$selfmd5" > receipt

@ -73,7 +73,7 @@ with open(test_init_file, 'w') as f:
f.write(''' f.write('''
devel/dump-rpc dfhack-rpc.txt devel/dump-rpc dfhack-rpc.txt
:lua dfhack.internal.addScriptPath(dfhack.getHackPath()) :lua dfhack.internal.addScriptPath(dfhack.getHackPath())
test --resume --modes=none,title "lua scr.breakdown_level=df.interface_breakdown_types.%s" test --resume -- lua scr.breakdown_level=df.interface_breakdown_types.%s
''' % ('NONE' if args.no_quit else 'QUIT')) ''' % ('NONE' if args.no_quit else 'QUIT'))
test_config_file = 'test_config.json' test_config_file = 'test_config.json'