Added a ruins UT (#18290)

* sdfa

* fas

* the godness guides, the godness protects

* sadf

* sdf

* fsa

* exoplanets_ruins config for UT

* sdaf

* sdf

* curse upon me
This commit is contained in:
Fluffy
2024-01-30 11:00:23 +00:00
committed by GitHub
parent 45390466f7
commit 1da2f6e7b8
21 changed files with 450 additions and 294 deletions
+123
View File
@@ -799,3 +799,126 @@ jobs:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
path: ./data/logs/**/condensed.log
retention-days: 5
###########################################
################ TEST RUINS ###############
###########################################
ruins-tests:
name: Run Ruins Tests
runs-on: ubuntu-22.04
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}}
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc]
services:
mariadb:
image: mariadb:10.11
ports:
- 3306
env:
MYSQL_USER: build
MYSQL_PASSWORD: build
MYSQL_DATABASE: game
MYSQL_ROOT_PASSWORD: root
concurrency:
group: unit-tests-ruins-tests-${{ matrix.map }}-${{ matrix.pod }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
strategy:
matrix:
map: [runtime]
pod: [ruins]
fail-fast: false
steps:
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode
- name: Setup TMATE session (Debug only)
uses: mxschmitt/action-tmate@v3
if: ${{ env.RUNNER_DEBUG_SHELL == true }}
with:
detached: true
timeout-minutes: 5
#Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
#Initialize the environment variables
- name: Set ENV variables
run: bash dependencies.sh
#Restores BYOND cache
- name: Restore BYOND cache
uses: actions/cache@v3
with:
path: ~/BYOND/*
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}
- name: Restore FlyWay cache
uses: actions/cache@v3
with:
path: ~/flyway
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }}
#Add the x86 architecture and update apt-get's local indexes
- name: Prepare OS Environtment
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
#Installs the packages we need, from a cache
- name: Install OS Packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386
version: 1.1
#And natively, the packages that break from a cache
- name: Install OS Packages (Native)
run: |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386
#Install flyway
- name: Install Flyway
run: |
tools/ci/install_flyway.sh
#Apply the database migration
- name: Apply Database Migrations (FlyWay)
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true"
- name: Install BYOND & rust_g
run: |
source dependencies.sh
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
bash tools/ci/install_rust_g.sh
- name: Configure pod, build and run
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
POD: ${{ matrix.pod }}
run: |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme
grep "0 warnings" build_log.txt
echo -n "$POD" > config/unit_test/identifier.txt
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt
echo "PORT $PORT" >> config/dbconfig.txt
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt
grep "All Unit Tests Passed" log.txt
(! grep "runtime error:" log.txt)
- name: Upload Condensed UT Log
uses: actions/upload-artifact@v3
if: failure() || ${{ runner.debug }}
with:
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log
path: ./data/logs/**/condensed.log
retention-days: 5