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

Finish filling out database CI matricies #1512

Merged
merged 2 commits into from
Jun 4, 2023
Merged
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
49 changes: 48 additions & 1 deletion .github/workflows/ci-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tests/Tgstation.Server.Tests/Live/HardFailLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public void Log<TState>(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");
Expand Down