mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Migrate basic build to drone (#10651)
* Adds drone tasks to Execute UTs on Aurora and Exodus * Adds a drone task to Migrate SQL and Perform the SQL UT on Runtime * Changes the SQL UT to respect the config.sql_enabled setting and use that sql connection * Changes the default config.sql_enabled state to 0, so uncommenting SQL_ENABLED has a actual effect * Moves a number of UT tests into a helper script (code_check.sh) * Updates the way the RUST_G dll/so is located * Adds a check to load_databases to verify that sql is enabled * Adds a check to establish_db_connection to verify that sql is enabled * Adds spearate config files used during the UTs (which hold the UT db connection info and enable/disable the db epending on the UT)
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
var/DBConnection/dbcon_ut
|
||||
|
||||
/proc/check_ut_db()
|
||||
if (!dbcon_ut)
|
||||
dbcon_ut = new("127.0.0.1", 3306, "ss13_test", "root")
|
||||
|
||||
return establish_db_connection(dbcon_ut)
|
||||
|
||||
/datum/unit_test/sql_preferences_columns
|
||||
name = "SQL: Preferences Columns"
|
||||
|
||||
/datum/unit_test/sql_preferences_columns/start_test()
|
||||
if (!check_ut_db())
|
||||
fail("Test DB setup failed.")
|
||||
if(!config.sql_enabled)
|
||||
log_unit_test("[ascii_yellow]--------------- Database not Configured - Skipping Preference Column UT")
|
||||
return TRUE
|
||||
|
||||
log_unit_test("[ascii_yellow]--------------- Database Configured - Running SQL Preference UTs")
|
||||
|
||||
if(!establish_db_connection(dbcon))
|
||||
log_unit_test("[ascii_red]--------------- Unable to establish database connection.")
|
||||
fail("Database connection could not be established.")
|
||||
return TRUE
|
||||
|
||||
var/faults = 0
|
||||
var/valid_columns = list()
|
||||
|
||||
// this is the worst unit test in the history of unit tests - geeves
|
||||
// At least the credentials are no longer hardcoded - arrow768
|
||||
var/list/table_names = list(
|
||||
"ss13_characters",
|
||||
"ss13_characters_flavour",
|
||||
@@ -27,7 +27,7 @@ var/DBConnection/dbcon_ut
|
||||
"ss13_characters_ipc_tags"
|
||||
)
|
||||
for (var/T in table_names)
|
||||
var/DBQuery/get_cs = dbcon_ut.NewQuery("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME` = :table:")
|
||||
var/DBQuery/get_cs = dbcon.NewQuery("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME` = :table:")
|
||||
get_cs.Execute(list("table" = T))
|
||||
|
||||
if (get_cs.ErrorMsg())
|
||||
@@ -47,7 +47,6 @@ var/DBConnection/dbcon_ut
|
||||
var/list/test_columns = list()
|
||||
var/list/temp
|
||||
|
||||
|
||||
temp = A.gather_load_query()
|
||||
for (var/B in temp)
|
||||
if (!test_columns[B])
|
||||
@@ -57,7 +56,6 @@ var/DBConnection/dbcon_ut
|
||||
test_columns[B] |= temp[B]["args"]
|
||||
temp.Cut()
|
||||
|
||||
|
||||
temp = A.gather_load_parameters()
|
||||
var/list/unfound = temp.Copy()
|
||||
for (var/C in temp)
|
||||
@@ -72,7 +70,6 @@ var/DBConnection/dbcon_ut
|
||||
faults++
|
||||
temp.Cut()
|
||||
|
||||
|
||||
temp = A.gather_save_query()
|
||||
for (var/B in temp)
|
||||
if (!test_columns[B])
|
||||
|
||||
Reference in New Issue
Block a user