Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validates sql in unit testing #6211

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
- name: Setup database
run: |
sudo systemctl start mysql
mysql -u root -proot -e "CREATE DATABASE cmdb;"
mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';";
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
Expand Down
2 changes: 0 additions & 2 deletions code/datums/_ndatabase/subsystems/database_query_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ GLOBAL_REAL(SSdatabase, /datum/controller/subsystem/database_query_manager)
NEW_SS_GLOBAL(SSdatabase)

/datum/controller/subsystem/database_query_manager/proc/start_up()
set waitfor = FALSE

settings = connection_settings_from_config(CONFIG_GET(string/db_provider))
connection = settings.create_connection()
connection.keep()
Expand Down
1 change: 0 additions & 1 deletion code/datums/_ndatabase/subsystems/entity_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ GLOBAL_REAL(SSentity_manager, /datum/controller/subsystem/entity_manager)
NEW_SS_GLOBAL(SSentity_manager)

/datum/controller/subsystem/entity_manager/proc/start_up()
set waitfor=0
UNTIL(SSdatabase.connection.connection_ready())
adapter = SSdatabase.connection.get_adapter()
prepare_tables()
Expand Down
26 changes: 17 additions & 9 deletions tools/ci/ci_config.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
SQL_ENABLED
ADDRESS 127.0.0.1
PORT 3306
FEEDBACK_DATABASE tg_ci
FEEDBACK_TABLEPREFIX
FEEDBACK_LOGIN root
FEEDBACK_PASSWORD
LAVALAND_BUDGET 0
SPACE_BUDGET 0
# server adapter
DB_PROVIDER brsql

# server address
DB_ADDRESS localhost

# server port
DB_PORT 3306

# server db
DB_DATABASE cmdb

# server login
DB_USERNAME root

# server password
DB_PASSWORD password
5 changes: 4 additions & 1 deletion tools/ci/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ echo Testing $MAP
tools/deploy.sh ci_test
mkdir ci_test/data

#test config
cp tools/ci/ci_config.txt ci_test/config/config.txt

#set the map
cp maps/$MAP.json ci_test/data/next_map.json
cp maps/templates/space.json ci_test/data/next_ship.json

cd ci_test
DreamDaemon colonialmarines.dmb -close -trusted -verbose -params "log-directory=ci"
RUST_BACKTRACE=1 DreamDaemon colonialmarines.dmb -close -trusted -verbose -params "log-directory=ci"
cd ..
cat ci_test/data/logs/ci/clean_run.lk
Loading