From d1d6aa4861faad829158e4dec9d3f869664c2150 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 4 Sep 2018 16:25:15 -0400 Subject: [PATCH] Add dotnet tests to travis --- .travis.yml | 44 +++++++++++++++++++++++++++++--------------- build/test_core.sh | 28 ++++++++++++++++++++++++++++ tgstation-server.sln | 3 ++- 3 files changed, 59 insertions(+), 16 deletions(-) create mode 100755 build/test_core.sh diff --git a/.travis.yml b/.travis.yml index 3643b77270..75c883bbba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,38 @@ language: generic sudo: false git: depth: 1 -env: - global: - - BYOND_MAJOR="511" - - BYOND_MINOR="1385" - - DMEName="tests/DMAPI/travistester.dme" -cache: - directories: - - $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR} +matrix: + include: + - env: + - DMAPI=true + - BYOND_MAJOR="511" + - BYOND_MINOR="1385" + - DMEName="tests/DMAPI/travistester.dme" + name: "DMAPI Unit Tests" + cache: + directories: + - $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR} -addons: - apt: - packages: - - libc6-i386 - - libstdc++6:i386 + addons: + apt: + packages: + - libc6-i386 + - libstdc++6:i386 + - env: + - DMAPI=false + name: "Linux Build" + dotnet: 2.1.300 + services: + - mysql + cache: + directories: + - $HOME/.nuget/packages install: - - build/install_byond.sh + - if [ $DMAPI = true ]; then build/install_byond.sh fi + - if [ $DMAPI = false ]; then nuget restore tgstation-server.sln fi script: - - tests/DMAPI/build_byond.sh + - if [ $DMAPI = true ]; then tests/DMAPI/build_byond.sh || travis_terminate 1 fi + - if [ $DMAPI = false ]; then build/test_core.sh fi diff --git a/build/test_core.sh b/build/test_core.sh new file mode 100755 index 0000000000..b73a692b69 --- /dev/null +++ b/build/test_core.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +cd tests/Tgstation.Server.Api.Tests + +dotnet test + +cd ../Tgstation.Server.Client.Tests + +dotnet test + +cd ../Tgstation.Server.Host.Tests + +dotnet test + +cd ../Tgstation.Server.Host.Watchdog.Tests + +dotnet test + +cd ../Tgstation.Server.Host.Console.Tests + +dotnet test + +cd ../Tgstation.Server.Host.Tests + +export TGS4_TEST_DATABASE_TYPE=MySql +export TGS4_TEST_CONNECTION_STRING="server=127.0.0.1;uid=root;pwd=;database=tgs_test" +dotnet test diff --git a/tgstation-server.sln b/tgstation-server.sln index bf94dec0a7..9f414672ca 100644 --- a/tgstation-server.sln +++ b/tgstation-server.sln @@ -25,6 +25,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6FF654E6 build\Dockerfile = build\Dockerfile build\Doxyfile = build\Doxyfile build\install_byond.sh = build\install_byond.sh + build\test_core.sh = build\test_core.sh build\tgs.docker.sh = build\tgs.docker.sh build\tgs.ico = build\tgs.ico build\UploadCoverage.ps1 = build\UploadCoverage.ps1 @@ -112,7 +113,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{E821 .github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tgstation.Server.Tests", "tests\Tgstation.Server.Tests\Tgstation.Server.Tests.csproj", "{09056964-1C74-445A-96EC-33F6DFC07916}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Tests", "tests\Tgstation.Server.Tests\Tgstation.Server.Tests.csproj", "{09056964-1C74-445A-96EC-33F6DFC07916}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution