Merge pull request #14969 from Putnam3145/reenable-tests

Reenable unit tests + auxmos update (so unit tests don't lie)
This commit is contained in:
silicons
2021-07-27 20:22:27 -07:00
committed by GitHub
42 changed files with 93 additions and 65 deletions
+6 -3
View File
@@ -88,18 +88,21 @@ jobs:
mysql -u root -proot tg_ci < SQL/tgstation_schema.sql
mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;'
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
- name: Install rust-g
- name: Install rust dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Install auxmos
run: |
bash tools/ci/install_auxmos.sh
- name: Compile and run tests
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build
# bash tools/ci/run_server.sh
tools/build/build -DCIBUILDING
bash tools/ci/run_server.sh
env:
CBT_BUILD_MODE: TEST_RUN
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
#define AUXMOS (world.system_type == MS_WINDOWS ? "auxmos.dll" : __detect_auxmos())
/proc/__detect_auxmos()
if (fexists("./libauxmos.so"))
return "./libauxmos.so"
else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so"))
return "[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so"
else
CRASH("Could not find libauxmos.so")
-2
View File
@@ -1,2 +0,0 @@
#define EXTOOLS (world.system_type == MS_WINDOWS ? "byond-extools.dll" : "libbyond-extools.so")
#define AUXMOS (world.system_type == MS_WINDOWS ? "auxmos.dll" : "libauxmos.so")
+9 -5
View File
@@ -10,12 +10,16 @@
GLOBAL_LIST_EMPTY(auxtools_initialized)
#define AUXTOOLS_CHECK(LIB)\
if (!GLOB.auxtools_initialized[LIB] && fexists(LIB)) {\
var/string = call(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = TRUE;\
if (!GLOB.auxtools_initialized[LIB]) {\
if (fexists(LIB)) {\
var/string = call(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = TRUE;\
} else {\
CRASH(string);\
}\
} else {\
CRASH(string);\
CRASH("No file named [LIB] found!")\
}\
}\
+1
View File
@@ -163,6 +163,7 @@ Turf and target are separate in case you want to teleport some distance from a t
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
/mob/proc/apply_pref_name(role, client/C)
set waitfor = FALSE
if(!C)
C = client
var/oldname = real_name
+5 -1
View File
@@ -11,6 +11,7 @@ SUBSYSTEM_DEF(activity)
/datum/controller/subsystem/activity/Initialize(timeofday)
RegisterSignal(SSdcs,COMSIG_GLOB_EXPLOSION,.proc/on_explosion)
RegisterSignal(SSdcs,COMSIG_GLOB_MOB_DEATH,.proc/on_death)
return ..()
/datum/controller/subsystem/activity/fire(resumed = 0)
calculate_threat()
@@ -54,7 +55,10 @@ SUBSYSTEM_DEF(activity)
var/weight = (text2num(threat_history[i+1])-text2num(threat_history[i]))
total_weight += weight
total_amt += weight * (threat_history[threat_history[i]])
return round(total_amt / total_weight,0.1)
if(total_weight == 0)
return total_amt
else
return round(total_amt / total_weight,0.1)
/datum/controller/subsystem/activity/proc/get_max_threat()
. = 0
+9 -10
View File
@@ -409,8 +409,7 @@ SUBSYSTEM_DEF(research)
var/datum/techweb_node/TN = techweb_nodes[id]
TN.Initialize()
techweb_nodes = returned
if (!verify_techweb_nodes()) //Verify all nodes have ids and such.
stack_trace("Invalid techweb nodes detected")
verify_techweb_nodes()
calculate_techweb_nodes()
calculate_techweb_boost_list()
if (!verify_techweb_nodes()) //Verify nodes and designs have been crosslinked properly.
@@ -442,52 +441,52 @@ SUBSYSTEM_DEF(research)
for(var/n in techweb_nodes)
var/datum/techweb_node/N = techweb_nodes[n]
if(!istype(N))
WARNING("Invalid research node with ID [n] detected and removed.")
stack_trace("Invalid research node with ID [n] detected and removed.")
techweb_nodes -= n
research_node_id_error(n)
. = FALSE
for(var/p in N.prereq_ids)
var/datum/techweb_node/P = techweb_nodes[p]
if(!istype(P))
WARNING("Invalid research prerequisite node with ID [p] detected in node [N.display_name]\[[N.id]\] removed.")
stack_trace("Invalid research prerequisite node with ID [p] detected in node [N.display_name]\[[N.id]\] removed.")
N.prereq_ids -= p
research_node_id_error(p)
. = FALSE
for(var/d in N.design_ids)
var/datum/design/D = techweb_designs[d]
if(!istype(D))
WARNING("Invalid research design with ID [d] detected in node [N.display_name]\[[N.id]\] removed.")
stack_trace("Invalid research design with ID [d] detected in node [N.display_name]\[[N.id]\] removed.")
N.design_ids -= d
design_id_error(d)
. = FALSE
for(var/u in N.unlock_ids)
var/datum/techweb_node/U = techweb_nodes[u]
if(!istype(U))
WARNING("Invalid research unlock node with ID [u] detected in node [N.display_name]\[[N.id]\] removed.")
stack_trace("Invalid research unlock node with ID [u] detected in node [N.display_name]\[[N.id]\] removed.")
N.unlock_ids -= u
research_node_id_error(u)
. = FALSE
for(var/p in N.boost_item_paths)
if(!ispath(p))
N.boost_item_paths -= p
WARNING("[p] is not a valid path.")
stack_trace("[p] is not a valid path.")
node_boost_error(N.id, "[p] is not a valid path.")
. = FALSE
var/list/points = N.boost_item_paths[p]
if(islist(points))
for(var/i in points)
if(!isnum(points[i]))
WARNING("[points[i]] is not a valid number.")
stack_trace("[points[i]] is not a valid number.")
node_boost_error(N.id, "[points[i]] is not a valid number.")
. = FALSE
else if(!point_types[i])
WARNING("[i] is not a valid point type.")
stack_trace("[i] is not a valid point type.")
node_boost_error(N.id, "[i] is not a valid point type.")
. = FALSE
else if(!isnull(points))
N.boost_item_paths -= p
node_boost_error(N.id, "No valid list.")
WARNING("No valid list.")
stack_trace("No valid list.")
. = FALSE
CHECK_TICK
+6 -8
View File
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(title)
/datum/controller/subsystem/title/Initialize()
if(file_path && icon)
return
return ..()
if(fexists("data/previous_title.dat"))
var/previous_path = file2text("data/previous_title.dat")
@@ -31,15 +31,13 @@ SUBSYSTEM_DEF(title)
if(length(title_screens))
file_path = "[global.config.directory]/title_screens/images/[pick(title_screens)]"
if(!file_path)
if(!file_path || !fexists(file_path))
file_path = "icons/default_title.dmi"
ASSERT(fexists(file_path))
icon = new(fcopy_rsc(file_path))
if(splash_turf)
splash_turf.icon = icon
if(fexists(file_path))
icon = new(fcopy_rsc(file_path))
if(splash_turf)
splash_turf.icon = icon
return ..()
+1 -1
View File
@@ -1,5 +1,5 @@
/datum/element/trash
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
element_flags = ELEMENT_DETACH
/datum/element/trash/Attach(datum/target)
. = ..()
+1 -1
View File
@@ -169,7 +169,7 @@
* * [/turf/open/space/proc/Initialize]
*/
/atom/proc/Initialize(mapload, ...)
// SHOULD_NOT_SLEEP(TRUE)
SHOULD_NOT_SLEEP(TRUE)
SHOULD_CALL_PARENT(TRUE)
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
@@ -53,7 +53,7 @@
bloodiness = 0
/obj/effect/decal/cleanable/blood/old/Initialize(mapload, list/datum/disease/diseases)
..()
. = ..()
icon_state += "-old"
add_blood_DNA(list("Non-human DNA" = "A+"))
+1 -1
View File
@@ -337,7 +337,7 @@
page_link = "Guide_to_chemistry"
/obj/item/book/manual/wiki/chemistry/Initialize()
..()
. = ..()
new /obj/item/book/manual/wiki/cit/chemistry(loc)
new /obj/item/book/manual/wiki/cit/chem_recipies(loc)
+1 -1
View File
@@ -466,7 +466,7 @@ GLOBAL_LIST_INIT(valid_plushie_paths, valid_plushie_paths())
can_random_spawn = FALSE
/obj/item/toy/plush/random/Initialize()
SHOULD_CALL_PARENT(FALSE)
..()
var/newtype
var/list/snowflake_list = CONFIG_GET(keyed_list/snowflake_plushies)
+1 -1
View File
@@ -48,7 +48,7 @@
amount -= max_amount
new type(loc, max_amount, FALSE)
if(!merge_type)
merge_type = type
merge_type = src.type
if(LAZYLEN(mats_per_unit))
set_mats_per_unit(mats_per_unit, 1)
+2 -2
View File
@@ -103,14 +103,14 @@
. = ..()
AddElement(/datum/element/polychromic, poly_colors, 3)
/obj/item/clothing/neck/cancloak/polychromic
/obj/item/clothing/neck/cloak/cancloak/polychromic
name = "canvas cloak"
desc = "A rugged cloak made of canvas."
icon_state = "cancloak"
item_state = "cloak"
var/list/poly_colors = list("#585858", "#373737", "#BEBEBE")
/obj/item/clothing/neck/cancloak/polychromic/ComponentInitialize()
/obj/item/clothing/neck/cloak/cancloak/polychromic/ComponentInitialize()
. = ..()
AddElement(/datum/element/polychromic, poly_colors, 3)
@@ -468,7 +468,7 @@
/obj/item/reagent_containers/medspray/sterilizine = 1)
/obj/machinery/smartfridge/organ/preloaded/Initialize()
..()
. = ..()
var/list = list(/obj/item/organ/tongue, /obj/item/organ/brain, /obj/item/organ/heart, /obj/item/organ/liver, /obj/item/organ/ears, /obj/item/organ/eyes, /obj/item/organ/tail, /obj/item/organ/stomach)
var/newtype = pick(list)
load(new newtype(src.loc))
@@ -19,7 +19,7 @@
/obj/item/integrated_circuit/atmospherics/Initialize()
air_contents = new(volume)
..()
return ..()
/obj/item/integrated_circuit/atmospherics/return_air()
return air_contents
@@ -439,6 +439,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
* * pref_load - Preferences to be loaded from character setup, loads in preferred mutant things like bodyparts, digilegs, skin color, etc.
*/
/datum/species/proc/on_species_gain(mob/living/carbon/C, datum/species/old_species, pref_load)
set waitfor = FALSE
// Drop the items the new species can't wear
for(var/slot_id in no_equip)
var/obj/item/thing = C.get_item_by_slot(slot_id)
@@ -173,4 +173,4 @@
if(prob(10))
var/obj/item/clothing/head/helmet/justice/escape/helmet = new(src)
equip_to_slot_or_del(helmet,SLOT_HEAD)
helmet.attack_self(src) // todo encapsulate toggle
INVOKE_ASYNC(helmet, /obj/item.proc/attack_self, src) // todo encapsulate toggle
@@ -33,7 +33,7 @@
/mob/living/simple_animal/bot/secbot/grievous/Initialize()
. = ..()
weapon = new baton_type(src)
weapon.attack_self(src)
INVOKE_ASYNC(weapon, /obj/item.proc/attack_self, src)
/mob/living/simple_animal/bot/secbot/grievous/Destroy()
QDEL_NULL(weapon)
@@ -381,6 +381,7 @@
..()
/mob/living/simple_animal/pet/dog/corgi/Ian/proc/Read_Memory()
set waitfor = FALSE
if(fexists("data/npc_saves/Ian.sav")) //legacy compatability to convert old format to new
var/savefile/S = new /savefile("data/npc_saves/Ian.sav")
S["age"] >> age
@@ -35,14 +35,16 @@
coffer.Grant(src)
riot = new /datum/action/cooldown/riot
riot.Grant(src)
AddElement(/datum/element/ventcrawling, given_tier = VENTCRAWLER_ALWAYS)
INVOKE_ASYNC(src, .proc/poll_for_player)
/mob/living/simple_animal/hostile/regalrat/proc/poll_for_player()
var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you want to play as the Royal Rat, cheesey be his crown?", ROLE_SENTIENCE, null, FALSE, 100, POLL_IGNORE_SENTIENCE_POTION)
if(LAZYLEN(candidates) && !mind)
var/mob/dead/observer/C = pick(candidates)
key = C.key
notify_ghosts("All rise for the rat king, ascendant to the throne in \the [get_area(src)].", source = src, action = NOTIFY_ORBIT, flashwindow = FALSE)
AddElement(/datum/element/ventcrawling, given_tier = VENTCRAWLER_ALWAYS)
/mob/living/simple_animal/hostile/regalrat/handle_automated_action()
if(prob(20))
riot.Trigger()
@@ -30,6 +30,7 @@
setup_visuals()
/mob/living/simple_animal/hostile/zombie/proc/setup_visuals()
set waitfor = FALSE
var/datum/preferences/dummy_prefs = new
dummy_prefs.pref_species = new /datum/species/zombie
dummy_prefs.be_random_body = TRUE
@@ -114,7 +114,7 @@
can_unsuppress = FALSE
/obj/item/gun/syringe/dart/Initialize()
..()
. = ..()
chambered = new /obj/item/ammo_casing/syringegun/dart(src)
/obj/item/gun/syringe/dart/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
@@ -42,6 +42,7 @@
return ..()
/obj/machinery/rnd/production/proc/update_research()
set waitfor = FALSE
host_research.copy_research_to(stored_research, TRUE)
update_designs()
@@ -55,7 +55,7 @@
display_name = "Nanite Replication Protocols"
description = "Advanced behaviours that allow nanites to exploit certain circumstances to replicate faster."
prereq_ids = list("nanite_smart")
design_ids = list("kickstart_nanites","factory_nanites","tinker_nanites","offline_nanites","synergy_nanites")
design_ids = list("kickstart_nanites","factory_nanites","offline_nanites","synergy_nanites")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
hidden = TRUE
experimental = TRUE
+1 -1
View File
@@ -44,7 +44,7 @@
// #include "heretic_knowledge.dm"
// #include "holidays.dm"
#include "initialize_sanity.dm"
#include "keybinding_init.dm"
// #include "keybinding_init.dm"
#include "machine_disassembly.dm"
#include "medical_wounds.dm"
#include "merge_type.dm"
+1 -1
View File
@@ -3,4 +3,4 @@
var/datum/keybinding/KB = i
if(initial(KB.keybind_signal) || !initial(KB.name))
continue
Fail("[KB.name] does not have a keybind signal defined.")
Fail("[initial(KB.name)] does not have a keybind signal defined.")
+2 -2
View File
@@ -10,6 +10,6 @@
var/list/paths = subtypesof(/obj/item/stack) - blacklist
for(var/stackpath in paths)
var/obj/item/stack/stack = stackpath
if(!initial(stack.merge_type))
var/obj/item/stack/stack = new stackpath
if(!stack.merge_type)
Fail("([stack]) lacks set merge_type variable!")
+5 -1
View File
@@ -53,7 +53,8 @@
TEST_ASSERT(!isnull(alice.get_bodypart(BODY_ZONE_HEAD)), "Alice has no head after prosthetic replacement")
TEST_ASSERT_EQUAL(alice.get_visible_name(), "Bob", "Bob's head was transplanted onto Alice's body, but their name is not Bob")
/*
i couldn't actually find anything in the parts of the code it's calling preventing two surgeries, so it's probably somewhere else
/datum/unit_test/multiple_surgeries/Run()
var/mob/living/carbon/human/user = allocate(/mob/living/carbon/human)
var/mob/living/carbon/human/patient_zero = allocate(/mob/living/carbon/human)
@@ -65,10 +66,12 @@
var/datum/surgery/organ_manipulation/surgery_for_zero = new
INVOKE_ASYNC(surgery_step, /datum/surgery_step/proc/initiate, user, patient_zero, BODY_ZONE_CHEST, scalpel, surgery_for_zero)
sleep(1)
TEST_ASSERT(surgery_for_zero.step_in_progress, "Surgery on patient zero was not initiated")
var/datum/surgery/organ_manipulation/surgery_for_one = new
// Without waiting for the incision to complete, try to start a new surgery
TEST_ASSERT(!surgery_step.initiate(user, patient_one, BODY_ZONE_CHEST, scalpel, surgery_for_one), "Was allowed to start a second surgery without the rod of asclepius")
TEST_ASSERT(!surgery_for_one.step_in_progress, "Surgery for patient one is somehow in progress, despite not initiating")
@@ -76,6 +79,7 @@
user.apply_status_effect(STATUS_EFFECT_HIPPOCRATIC_OATH)
INVOKE_ASYNC(surgery_step, /datum/surgery_step/proc/initiate, user, patient_one, BODY_ZONE_CHEST, scalpel, surgery_for_one)
TEST_ASSERT(surgery_for_one.step_in_progress, "Surgery on patient one was not initiated, despite having rod of asclepius")
*/
/datum/unit_test/tend_wounds/Run()
var/mob/living/carbon/human/patient = allocate(/mob/living/carbon/human)
+1 -1
View File
@@ -1,8 +1,8 @@
/datum/unit_test/auto_teleporter_linking/Run()
// Put down the teleporter machinery
var/obj/machinery/teleport/hub/hub = allocate(/obj/machinery/teleport/hub)
var/obj/machinery/teleport/station/station = allocate(/obj/machinery/teleport/station, locate(run_loc_bottom_left.x + 1, run_loc_bottom_left.y, run_loc_bottom_left.z))
var/obj/machinery/computer/teleporter/computer = allocate(/obj/machinery/computer/teleporter, locate(run_loc_bottom_left.x + 2, run_loc_bottom_left.y, run_loc_bottom_left.z))
var/obj/machinery/teleport/station/station = allocate(/obj/machinery/teleport/station, locate(run_loc_bottom_left.x + 1, run_loc_bottom_left.y, run_loc_bottom_left.z))
TEST_ASSERT_EQUAL(hub.power_station, station, "Hub didn't link to the station")
TEST_ASSERT_EQUAL(station.teleporter_console, computer, "Station didn't link to the teleporter console")
+1 -1
View File
@@ -21,7 +21,7 @@
/obj/item/clothing/suit/jacket/puffer/vest = 4,
/obj/item/clothing/suit/jacket/puffer = 4,
/obj/item/clothing/suit/hooded/cloak/david = 4,
/obj/item/clothing/neck/cancloak/polychromic = 4,
/obj/item/clothing/neck/cloak/cancloak/polychromic = 4,
/obj/item/clothing/suit/bomber = 5,
/obj/item/clothing/under/suit/turtle/teal = 3,
/obj/item/clothing/under/suit/turtle/grey = 3,
+3 -3
View File
@@ -4,14 +4,14 @@
#Final authority on what's required to fully build the project
# byond version
export BYOND_MAJOR=513
export BYOND_MINOR=1536
export BYOND_MAJOR=514
export BYOND_MINOR=1556
#rust_g git tag
export RUST_G_VERSION=0.4.8
#auxmos git tag
export AUXMOS_VERSION=v0.2.1
export AUXMOS_VERSION=v0.2.2
#node version
export NODE_VERSION=12
@@ -103,6 +103,6 @@
/datum/gear/neck/cancloak
name = "Canvas Cloak"
path = /obj/item/clothing/neck/cancloak/polychromic
path = /obj/item/clothing/neck/cloak/cancloak/polychromic
loadout_flags = LOADOUT_CAN_NAME | LOADOUT_CAN_DESCRIPTION | LOADOUT_CAN_COLOR_POLYCHROMIC
loadout_initial_colors = list("#585858", "#373737", "#BEBEBE")
+1 -1
View File
@@ -17,7 +17,7 @@
#include "_maps\_basemap.dm"
#include "code\_compile_options.dm"
#include "code\world.dm"
#include "code\__DEFINES\_extools.dm"
#include "code\__DEFINES\_auxtools.dm"
#include "code\__DEFINES\_globals.dm"
#include "code\__DEFINES\_protect.dm"
#include "code\__DEFINES\_tick.dm"
+1 -1
View File
@@ -124,7 +124,7 @@ const taskDm = (...injectedDefines) => new Task('dm')
.depends('html/**')
.depends('icons/**')
.depends('interface/**')
.depends(process.platform === 'win32' ? 'byond-extools.*' : 'libbyond-extools.*')
.depends(process.platform === 'win32' ? 'auxmos.*' : 'libauxmos.*')
.depends('tgui/public/tgui.html')
.depends('tgui/public/*.bundle.*')
.depends(`${DME_NAME}.dme`)
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
source dependencies.sh
mkdir -p ~/.byond/bin
wget -O ~/.byond/bin/libauxmos.so "https://github.com/Putnam3145/auxmos/releases/download/${AUXMOS_VERSION}/libauxmos.so"
chmod +x ~/.byond/bin/libauxmos.so
ldd ~/.byond/bin/libauxmos.so
Executable → Regular
View File
-5
View File
@@ -7,11 +7,6 @@ mkdir ci_test/config
#test config
cp tools/ci/ci_config.txt ci_test/config/config.txt
#throw extools into ldd
cp libbyond-extools.so ~/.byond/bin/libbyond-extools.so
chmod +x ~/.byond/bin/libbyond-extools.so
ldd ~/.byond/bin/libbyond-extools.so
cd ci_test
DreamDaemon tgstation.dmb -close -trusted -verbose -params "log-directory=ci"
cd ..
-2
View File
@@ -22,8 +22,6 @@ fi
cp tgstation.dmb tgstation.rsc $1/
cp -r _maps/* $1/_maps/
cp -r icons/runtime/* $1/icons/runtime/
cp -r sound/runtime/* $1/sound/runtime/
cp -r strings/* $1/strings/
#remove .dm files from _maps