unit->game tests, /tg/ assertions and allocations (#27646)

* unit->game tests, /tg/ assertions and allocations

* whoopsies

* fix lint
This commit is contained in:
warriorstar-orion
2024-12-21 21:19:33 +00:00
committed by GitHub
parent 79bad427c8
commit bb60a027bf
53 changed files with 304 additions and 243 deletions
@@ -22,7 +22,7 @@
/datum/configuration_section/database_configuration/load_data(list/data)
// UNIT TESTS ARE DEFINED - USE CUSTOM CI VALUES
#ifdef UNIT_TESTS
#ifdef GAME_TESTS
enabled = TRUE
// This needs to happen in the CI environment to ensure the example SQL version gets updated.
@@ -8,7 +8,7 @@
/datum/configuration_section/redis_configuration/load_data(list/data)
// UNIT TESTS ARE DEFINED - USE CUSTOM CI VALUES
#ifdef UNIT_TESTS
#ifdef GAME_TESTS
// enabled = TRUE
+1 -1
View File
@@ -83,7 +83,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
/datum/controller/master/New()
if(!random_seed)
#ifdef UNIT_TESTS
#ifdef GAME_TESTS
random_seed = 29051994
#else
random_seed = rand(1, 1e9)
+1 -1
View File
@@ -104,7 +104,7 @@ SUBSYSTEM_DEF(dbcore)
/datum/controller/subsystem/dbcore/proc/CheckSchemaVersion()
if(GLOB.configuration.database.enabled)
// The unit tests have their own version of this check, which wont hold the server up infinitely, so this is disabled if we are running unit tests
#ifndef UNIT_TESTS
#ifndef GAME_TESTS
if(GLOB.configuration.database.enabled && GLOB.configuration.database.version != SQL_VERSION)
GLOB.configuration.database.enabled = FALSE
schema_valid = FALSE
+1 -1
View File
@@ -67,7 +67,7 @@ SUBSYSTEM_DEF(redis)
// Redis integration stuff
/datum/controller/subsystem/redis/proc/connect()
if(GLOB.configuration.redis.enabled)
#ifndef UNIT_TESTS // CI uses linux so dont flag up a fail there
#ifndef GAME_TESTS // CI uses linux so dont flag up a fail there
if(world.system_type == UNIX)
stack_trace("SSredis has known to be very buggy when running on Linux with random dropouts ocurring due to interrupted syscalls. You have been warned!")
#endif
+1 -1
View File
@@ -363,7 +363,7 @@ SUBSYSTEM_DEF(ticker)
if(GLOB.configuration.general.enable_night_shifts)
SSnightshift.check_nightshift(TRUE)
#ifdef UNIT_TESTS
#ifdef GAME_TESTS
// Run map tests first in case unit tests futz with map state
GLOB.test_runner.RunMap()
GLOB.test_runner.Run()
+1 -1
View File
@@ -75,7 +75,7 @@ SUBSYSTEM_DEF(verb_manager)
//we want unit tests to be able to directly call verbs that attempt to queue, and since unit tests should test internal behavior, we want the queue
//to happen as if it was actually from player input if its called on a mob.
#ifdef UNIT_TESTS
#ifdef GAME_TESTS
if(QDELETED(usr) && ismob(incoming_callback.object))
incoming_callback.usr_uid = incoming_callback.object.UID()
var/datum/callback/new_us = CALLBACK(arglist(list(GLOBAL_PROC, GLOBAL_PROC_REF(_queue_verb)) + args.Copy()))
@@ -88,7 +88,7 @@ SUBSYSTEM_DEF(mapping)
// Load all Z level templates
preloadTemplates()
preloadTemplates(path = "code/modules/unit_tests/atmos/")
preloadTemplates(path = "code/tests/atmos/")
// Load the station
loadStation()