Skip to content

Commit

Permalink
Add an additional test pass run on all mods
Browse files Browse the repository at this point in the history
Currently our CI doesn't check mod json except for a couple of cases,
and in one of those cases (Magiclysm) it doesn't check it on json-only
PRs, which is unhelpful.

Add an additional test run, called as part of the TEST_STAGE CI job
(i.e. the first one, which runs in full on json-only changes).  This
runs the test executable with every mod enabled (except those from a
blacklist), without actually running any tests.

The purposes is simply to load all of the mod json, enabling us to catch
any errors therein.
  • Loading branch information
jbytheway committed Dec 15, 2019
1 parent abd313a commit e46bf0d
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ else
fi
wait -n
fi

if [ -n "$TEST_STAGE" ]
then
# Run the tests one more time, without actually running any tests, just to verify that all
# the mod data can be successfully loaded

# Use a blacklist of mods that currently fail to load cleanly. Hopefully this list will
# shrink over time.
blacklist=build-scripts/mod_test_blacklist
mods="$(./build-scripts/get_all_mods.sh | grep -v -F -f $blacklist | tr '\n' ',')"
run_tests ./tests/cata_test --user-dir=all_modded --mods="$mods" '~*'
fi
fi
ccache --show-stats

Expand Down
23 changes: 23 additions & 0 deletions build-scripts/get_all_mods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e
set -u

if [ ! -d data/mods ]
then
printf "Expected to be run from the Cata root directory" >&2
exit 1
fi

idents=

for info in data/mods/*/modinfo.json
do
ident=$(python3 -c '
import json;
print("\n".join(e["ident"] for e in json.load(open("'"$info"'"))
if e["type"] == "MOD_INFO"))')
idents="$idents"$'\n'"$ident"
done

printf '%s' "${idents}"
50 changes: 50 additions & 0 deletions build-scripts/mod_test_blacklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
aftershock
alt_map_key
Animatronics
Battery_Overhaul_Legacy_Mode
blazemod
cbm_slots
classic_zombies
crazy_cataclysm
crt_expansion
desertpack
DinoMod
ew_pack
FIC_Weapons
FujiStruct
generic_guns
Graphical_Overmap
growable-pots
Heavy miners
hydroponics
manualbionicinstall
mapgen_demo
Medieval_Stuff
MMA
modular_turrets
more_locations
More_Survival_Tools
mutant_npcs
my_sweet_cataclysm
national_guard_camp
No_Anthills
No_Bees
no_faults
no_filthy_clothing
No_Fungi
no_medieval_items
no_npc_food
No_Rail_Stations
No_Triffids
novitamins
realguns
safeautodoc
Salvaged_Robots
sees_player_hitbutton
sees_player_retro
sleepdeprivation
speedydex
stats_through_kills
Tanks
Tolerate_This
Urban_Development

0 comments on commit e46bf0d

Please sign in to comment.