JSON Logging Refactor (#18252)

* First pass

* fixes

* more fixes

* num2hex length changes

* pass 2

* fixed warning

* looc log fix

* .

* update tgui

* .

* .

* .

* .

* perttier

* cleanup

* .

* .

* fix token

* no

* .

* .

* .

* ,

* modsay eventsay

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-09-11 17:28:20 +02:00
committed by GitHub
co-authored by Kashargul
parent 67fa43bd5a
commit b0f0f4685f
403 changed files with 4013 additions and 2309 deletions
+1
View File
@@ -101,6 +101,7 @@
#include "language_tests.dm"
#include "loadout_tests.dm"
#include "map_tests.dm"
#include "mapping.dm"
#include "material_tests.dm"
// #include "nuke_cinematic.dm" // TODO: This is probably fixed later on
#include "poster_tests.dm"
@@ -25,8 +25,7 @@
* If there are any differences, note them.
*/
/datum/unit_test/font_awesome_icons/proc/load_parse_verify()
//log_test("CSS Actual: [length(font_awesome_css)]")
log_unit_test("CSS Actual: [length(font_awesome_css)]")
log_test("CSS Actual: [length(font_awesome_css)]")
allowed_icons = parse_fa_css_into_icon_list(font_awesome_css)
/**
+19
View File
@@ -0,0 +1,19 @@
/// Conveys all log_mapping messages as unit test failures, as they all indicate mapping problems.
/datum/unit_test/log_mapping
// Happen before all other tests, to make sure we only capture normal mapping logs.
priority = TEST_PRE
/datum/unit_test/log_mapping/Run()
var/static/regex/test_areacoord_regex = regex(@"\(-?\d+,-?\d+,(-?\d+)\)")
for(var/log_entry in GLOB.unit_test_mapping_logs)
// Only fail if AREACOORD was conveyed, and it's a station or mining z-level. FIXME: SEE BELOW!
// This is due to mapping errors don't have coords being impossible to diagnose as a unit test,
// and various ruins frequently intentionally doing non-standard things.
if(!test_areacoord_regex.Find(log_entry))
continue
// var/z = text2num(test_areacoord_regex.group[1])
//if(!is_station_level(z) && !is_mining_level(z)) // FIXME: We cannot check for these yet!
// continue
TEST_FAIL(log_entry)
+3 -6
View File
@@ -138,15 +138,13 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
if (fexists(filename))
var/data_filename = "data/screenshots/[path_prefix]_[name].png"
fcopy(icon, data_filename)
//log_test("\t[path_prefix]_[name] was found, putting in data/screenshots")
log_unit_test("\t[path_prefix]_[name] was found, putting in data/screenshots")
log_test("\t[path_prefix]_[name] was found, putting in data/screenshots")
else
#ifdef CIBUILDING
// We are runing in real CI, so just pretend it worked and move on
fcopy(icon, "data/screenshots_new/[path_prefix]_[name].png")
//log_test("\t[path_prefix]_[name] was put in data/screenshots_new")
log_unit_test("\t[path_prefix]_[name] was put in data/screenshots_new")
log_test("\t[path_prefix]_[name] was put in data/screenshots_new")
#else
// We are probably running in a local build
fcopy(icon, filename)
@@ -230,8 +228,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
if(length(log_entry))
message = log_entry.Join("\n")
//log_test(message)
log_unit_test(message)
log_test(message)
test_output_desc += " [duration / 10]s"
if (test.succeeded)