Files
Paradise/code/modules/unit_tests/sql.dm
AffectedArc07 841f56fe83 Migrates from Travis CI To Actions (#14958)
* Migrates from Travis CI To Actions

First hitch

Surprise surprise NanoUI is the issue

...

Please work

Final Commit

* Undoes an oops
2020-11-21 09:08:50 -07:00

43 lines
1.2 KiB
Plaintext

// Unit test to check SQL version has been updated properly.,
/datum/unit_test/sql_version/Run()
// Check if the SQL version set in the code is equal to the CI DB config
if(config.sql_enabled && sql_version != SQL_VERSION)
Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/ci/dbconfig.txt")
// Check if the CI DB config is up to date with the example dbconfig
// This proc is a little unclean but it works
var/example_db_version
var/list/Lines = file2list("config/example/dbconfig.txt")
for(var/t in Lines)
if(!t) continue
t = trim(t)
if(length(t) == 0)
continue
else if(copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if(!name)
continue
switch(name)
if("db_version")
example_db_version = text2num(value)
if(!example_db_version)
Fail("SQL version error: File config/example/dbconfig.txt does not have a valid SQL version set!")
if(example_db_version != SQL_VERSION)
Fail("SQL version error: Game is running V[SQL_VERSION] but config/example/dbconfig.txt is V[example_db_version].")