From 0a54653ac41854a1f4c0c3a8ef601d8293ff4d18 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:01:47 +0100 Subject: [PATCH] validates sql in unit testing --- .github/workflows/run_unit_tests.yml | 11 +++++++++++ tools/ci/ci_config.txt | 26 +++++++++++++++++--------- tools/ci/run_server.sh | 4 ++++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 539b0fa01082..c2116dba10e7 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -16,6 +16,13 @@ on: jobs: run_unit_tests: runs-on: ubuntu-latest + services: + mysql: + image: mysql:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306 steps: - uses: actions/checkout@v3 - name: Restore BYOND cache @@ -23,6 +30,10 @@ 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;' - name: Install rust-g run: | sudo dpkg --add-architecture i386 diff --git a/tools/ci/ci_config.txt b/tools/ci/ci_config.txt index 4925d781bbbe..2dc09472b980 100644 --- a/tools/ci/ci_config.txt +++ b/tools/ci/ci_config.txt @@ -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 diff --git a/tools/ci/run_server.sh b/tools/ci/run_server.sh index 93f58be5f7c5..d9abc8dd497d 100644 --- a/tools/ci/run_server.sh +++ b/tools/ci/run_server.sh @@ -6,8 +6,12 @@ MAP=$1 echo Testing $MAP tools/deploy.sh ci_test +mkdir ci_test/config 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