From 2f99378122910c0fca4c0e3be7006cd6b433048f Mon Sep 17 00:00:00 2001 From: Dominion Date: Sat, 3 Jun 2023 10:59:00 -0400 Subject: [PATCH 1/2] Finish filling out database CI matricies --- .github/workflows/ci-suite.yml | 49 +++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-suite.yml b/.github/workflows/ci-suite.yml index bd4f690ed2e..f8b7050ea27 100644 --- a/.github/workflows/ci-suite.yml +++ b/.github/workflows/ci-suite.yml @@ -312,7 +312,7 @@ jobs: strategy: fail-fast: false matrix: - database-type: [ 'SqlServer' ] + database-type: [ 'SqlServer', 'Sqlite', 'PostgresSql', 'MariaDB', 'MySql' ] watchdog-type: [ 'Basic', 'System' ] configuration: [ 'Debug', 'Release' ] runs-on: windows-2019 @@ -333,6 +333,46 @@ jobs: if: ${{ matrix.watchdog-type == 'Basic' }} run: echo "General__UseBasicWatchdog=true" >> $Env:GITHUB_ENV + - name: Set Sqlite Connection Info + if: ${{ matrix.database-type == 'Sqlite' }} + shell: bash + run: | + echo "TGS_TEST_DATABASE_TYPE=Sqlite" >> $GITHUB_ENV + echo "TGS_TEST_CONNECTION_STRING=Data Source=TGS_${{ matrix.watchdog-type }}_${{ matrix.configuration }}.sqlite3;Mode=ReadWriteCreate" >> $GITHUB_ENV + + - name: Setup Postgres + uses: ankane/setup-postgres@v1 + if: ${{ matrix.database-type == 'PostgresSql' }} + + - name: Set PostgresSql Connection Info + if: ${{ matrix.database-type == 'PostgresSql' }} + shell: bash + run: | + echo "TGS_TEST_DATABASE_TYPE=PostgresSql" >> $GITHUB_ENV + echo "TGS_TEST_CONNECTION_STRING=Application Name=tgstation-server;Host=127.0.0.1;Username=$USER;Database=TGS__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV + + - name: Setup MariaDB + uses: ankane/setup-mariadb@v1 + if: ${{ matrix.database-type == 'MariaDB' }} + + - name: Set MariaDB Connection Info + if: ${{ matrix.database-type == 'MariaDB' }} + shell: bash + run: | + echo "TGS_TEST_DATABASE_TYPE=MariaDB" >> $GITHUB_ENV + echo "TGS_TEST_CONNECTION_STRING=Server=127.0.0.1;uid=root;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV + + - name: Setup MySQL + uses: ankane/setup-mysql@v1 + if: ${{ matrix.database-type == 'MySql' }} + + - name: Set MySQL Connection Info + if: ${{ matrix.database-type == 'MySql' }} + shell: bash + run: | + echo "TGS_TEST_DATABASE_TYPE=MySql" >> $GITHUB_ENV + echo "TGS_TEST_CONNECTION_STRING=Server=127.0.0.1;uid=root;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV + - name: Set SqlServer Connection Info if: ${{ matrix.database-type == 'SqlServer' }} shell: bash @@ -394,6 +434,13 @@ jobs: needs: dmapi-build if: "!(cancelled() || failure()) && needs.dmapi-build.result == 'success'" services: # We start all dbs here so we can just code the stuff once + mssql: + image: mcr.microsoft.com/mssql/server:2019-latest + env: + SA_PASSWORD: myPassword + ACCEPT_EULA: 'Y' + ports: + - 1433:1433 postgres: image: cyberboss/postgres-max-connections # Fork of _/postgres:latest with max_connections=500 becuase GitHub actions service containers have no way to set command lines. Rebuilds with updates. ports: From 6936b734220be801e42f37500085e5b15232f55c Mon Sep 17 00:00:00 2001 From: Dominion Date: Sat, 3 Jun 2023 19:35:44 -0400 Subject: [PATCH 2/2] Additional log message exception --- tests/Tgstation.Server.Tests/Live/HardFailLogger.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs b/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs index 1f66ee01f6d..262173a5d2c 100644 --- a/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs +++ b/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs @@ -25,7 +25,8 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except var logMessage = formatter(state, exception); if ((logLevel == LogLevel.Error && !logMessage.StartsWith("Error disconnecting connection ") - && !(logMessage.StartsWith("An exception occurred while iterating over the results of a query for context type") && (exception is TaskCanceledException || exception?.InnerException is TaskCanceledException))) + && !(logMessage.StartsWith("An exception occurred while iterating over the results of a query for context type") && (exception is OperationCanceledException || exception?.InnerException is OperationCanceledException)) + && !(logMessage.StartsWith("An exception occurred in the database while saving changes for context type") && (exception is OperationCanceledException || exception?.InnerException is OperationCanceledException))) || (logLevel == LogLevel.Critical && logMessage != "DropDatabase configuration option set! Dropping any existing database...")) { Console.WriteLine("UNEXPECTED ERROR OCCURS NEAR HERE");