mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
Separate station/unit tests and disable lavaland procgen and ruin spawning in tests (for now). (#28106)
* Separate station/unit tests and disable lavaland. * add CI/local test conflict check back
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Map per-tile test.
|
||||
*
|
||||
* Per-tile map tests iterate over each tile of a map to perform a check, and
|
||||
* fails the test if a tile does not pass the check. A new test can be
|
||||
* written by extending /datum/map_per_tile_test, and implementing the check
|
||||
* in CheckTile.
|
||||
*/
|
||||
/datum/map_per_tile_test
|
||||
var/succeeded = TRUE
|
||||
var/list/fail_reasons
|
||||
var/failure_count = 0
|
||||
|
||||
/datum/map_per_tile_test/proc/CheckTile(turf/T)
|
||||
Fail("CheckTile() called parent or not implemented")
|
||||
|
||||
/datum/map_per_tile_test/proc/Fail(turf/T, reason)
|
||||
succeeded = FALSE
|
||||
LAZYADD(fail_reasons, "[T.x],[T.y],[T.z]: [reason]")
|
||||
failure_count++
|
||||
@@ -1,9 +1,14 @@
|
||||
//include game test files in this module in this ifdef
|
||||
//Keep this sorted alphabetically
|
||||
|
||||
#ifdef GAME_TESTS
|
||||
#ifdef TEST_RUNNER
|
||||
#include "_game_test_puppeteer.dm"
|
||||
#include "_game_test.dm"
|
||||
#include "_map_per_tile_test.dm"
|
||||
#include "test_runner.dm"
|
||||
#endif
|
||||
|
||||
#ifdef GAME_TESTS
|
||||
#include "atmos\test_ventcrawl.dm"
|
||||
#include "attack_chain\test_attack_chain_cult_dagger.dm"
|
||||
#include "attack_chain\test_attack_chain_machinery.dm"
|
||||
@@ -13,7 +18,6 @@
|
||||
#include "jobs\test_job_globals.dm"
|
||||
#include "test_aicard_icons.dm"
|
||||
#include "test_announcements.dm"
|
||||
#include "test_areas_apcs.dm"
|
||||
#include "test_components.dm"
|
||||
#include "test_config_sanity.dm"
|
||||
#include "test_crafting_lists.dm"
|
||||
@@ -22,12 +26,10 @@
|
||||
#include "test_init_sanity.dm"
|
||||
#include "test_log_format.dm"
|
||||
#include "test_map_templates.dm"
|
||||
#include "test_map_tests.dm"
|
||||
#include "test_missing_icons.dm"
|
||||
#include "test_origin_tech.dm"
|
||||
#include "test_purchase_reference_test.dm"
|
||||
#include "test_reagent_id_typos.dm"
|
||||
#include "test_runner.dm"
|
||||
#include "test_rustg_version.dm"
|
||||
#include "test_spawn_humans.dm"
|
||||
#include "test_spell_targeting_test.dm"
|
||||
@@ -37,3 +39,8 @@
|
||||
#include "test_subsystem_metric_sanity.dm"
|
||||
#include "test_timer_sanity.dm"
|
||||
#endif
|
||||
|
||||
#ifdef MAP_TESTS
|
||||
#include "test_areas_apcs.dm"
|
||||
#include "test_map_tests.dm"
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
/**
|
||||
* Map per-tile test.
|
||||
*
|
||||
* Per-tile map tests iterate over each tile of a map to perform a check, and
|
||||
* fails the test if a tile does not pass the check. A new test can be
|
||||
* written by extending /datum/map_per_tile_test, and implementing the check
|
||||
* in CheckTile.
|
||||
*/
|
||||
/datum/map_per_tile_test
|
||||
var/succeeded = TRUE
|
||||
var/list/fail_reasons
|
||||
var/failure_count = 0
|
||||
|
||||
/datum/map_per_tile_test/proc/CheckTile(turf/T)
|
||||
Fail("CheckTile() called parent or not implemented")
|
||||
|
||||
/datum/map_per_tile_test/proc/Fail(turf/T, reason)
|
||||
succeeded = FALSE
|
||||
LAZYADD(fail_reasons, "[T.x],[T.y],[T.z]: [reason]")
|
||||
failure_count++
|
||||
|
||||
/**
|
||||
* Check to ensure that APCs have a cable node on their tile.
|
||||
*/
|
||||
|
||||
+39
-31
@@ -22,38 +22,18 @@
|
||||
// Running the tests is part of the ticker's start function, because I cant think of any better place to put it
|
||||
SSticker.force_start = TRUE
|
||||
|
||||
|
||||
/datum/test_runner/proc/RunMap(z_level = 2)
|
||||
CHECK_TICK
|
||||
|
||||
var/list/tests = list()
|
||||
|
||||
for(var/I in subtypesof(/datum/map_per_tile_test))
|
||||
tests += new I
|
||||
test_logs[I] = list()
|
||||
durations[I] = 0
|
||||
|
||||
for(var/turf/T in block(1, 1, z_level, world.maxx, world.maxy, z_level))
|
||||
for(var/datum/map_per_tile_test/test in tests)
|
||||
if(test.failure_count < MAX_MAP_TEST_FAILURE_COUNT)
|
||||
var/duration = REALTIMEOFDAY
|
||||
test.CheckTile(T)
|
||||
durations[test.type] += REALTIMEOFDAY - duration
|
||||
|
||||
if(test.failure_count >= MAX_MAP_TEST_FAILURE_COUNT)
|
||||
test.Fail(T, "failure threshold reached at this tile")
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
for(var/datum/map_per_tile_test/test in tests)
|
||||
if(!test.succeeded)
|
||||
failed_any_test = TRUE
|
||||
test_logs[test.type] += test.fail_reasons
|
||||
|
||||
QDEL_LIST_CONTENTS(tests)
|
||||
|
||||
/datum/test_runner/proc/RunAll()
|
||||
#ifdef MAP_TESTS
|
||||
// Run map tests first in case unit tests futz with map state
|
||||
RunMap()
|
||||
#endif
|
||||
#ifdef GAME_TESTS
|
||||
Run()
|
||||
#endif
|
||||
SSticker.reboot_helper("Unit Test Reboot", "tests ended", 0)
|
||||
|
||||
/datum/test_runner/proc/Run()
|
||||
log_world("Test runner: game tests.")
|
||||
CHECK_TICK
|
||||
|
||||
for(var/I in subtypesof(/datum/game_test))
|
||||
@@ -84,10 +64,38 @@
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
SSticker.reboot_helper("Unit Test Reboot", "tests ended", 0)
|
||||
/datum/test_runner/proc/RunMap(z_level = 2)
|
||||
log_world("Test runner: map tests.")
|
||||
CHECK_TICK
|
||||
|
||||
var/list/tests = list()
|
||||
|
||||
for(var/I in subtypesof(/datum/map_per_tile_test))
|
||||
tests += new I
|
||||
test_logs[I] = list()
|
||||
durations[I] = 0
|
||||
|
||||
for(var/turf/T in block(1, 1, z_level, world.maxx, world.maxy, z_level))
|
||||
for(var/datum/map_per_tile_test/test in tests)
|
||||
if(test.failure_count < MAX_MAP_TEST_FAILURE_COUNT)
|
||||
var/duration = REALTIMEOFDAY
|
||||
test.CheckTile(T)
|
||||
durations[test.type] += REALTIMEOFDAY - duration
|
||||
|
||||
if(test.failure_count >= MAX_MAP_TEST_FAILURE_COUNT)
|
||||
test.Fail(T, "failure threshold reached at this tile")
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
for(var/datum/map_per_tile_test/test in tests)
|
||||
if(!test.succeeded)
|
||||
failed_any_test = TRUE
|
||||
test_logs[test.type] += test.fail_reasons
|
||||
|
||||
QDEL_LIST_CONTENTS(tests)
|
||||
|
||||
/datum/test_runner/proc/Finalize(emit_failures = FALSE)
|
||||
log_world("Test runner: finalizing.")
|
||||
var/time = world.timeofday
|
||||
set waitfor = FALSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user