Skip to content

Run core tests on Windows and test run stability #1601

Run core tests on Windows and test run stability

Run core tests on Windows and test run stability #1601

Workflow file for this run

name: Test
on:
pull_request: {}
push:
branches:
- main
jobs:
# linux_test:
# name: Linux
# strategy:
# fail-fast: false
# matrix:
# config:
# - branch: 'v2.9'
# - branch: 'latest'
# - branch: 'main'
# runs-on: ubuntu-latest
# env:
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
# NUGET_XMLDOC_MODE: skip
# steps:
# - name: Install nats-server
# run: |
# branch=$(curl https://api.mtmk.dev/gh/v1/releases/tag/nats-io/nats-server/${{ matrix.config.branch }})
# for i in 1 2 3
# do
# curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@$branch | PREFIX=. sh && break || sleep 30
# done
# sudo mv nats-server /usr/local/bin
#
# - name: Check nats-server
# run: nats-server -v
#
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Setup dotnet
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: '8.x'
#
# - name: Build
# run: dotnet build -c Debug
#
# - name: Test Core
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Core.Tests/NATS.Client.Core.Tests.csproj
#
# - name: Test Core2
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Core2.Tests/NATS.Client.Core2.Tests.csproj
#
# - name: Test CoreUnit
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.CoreUnit.Tests/NATS.Client.CoreUnit.Tests.csproj
#
# - name: Test JetStream
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.JetStream.Tests/NATS.Client.JetStream.Tests.csproj
#
# - name: Test Key/Value Store
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.KeyValueStore.Tests/NATS.Client.KeyValueStore.Tests.csproj
#
# - name: Test Object Store
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.ObjectStore.Tests/NATS.Client.ObjectStore.Tests.csproj
#
# - name: Test Services
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Services.Tests/NATS.Client.Services.Tests.csproj
#
# - name: Test OpenTelemetry
# run: dotnet test -c Debug --no-build --logger:"console;verbosity=normal" tests/NATS.Net.OpenTelemetry.Tests/NATS.Net.OpenTelemetry.Tests.csproj
#
# - name: Check Native AOT
# run: |
# cd tests/NATS.Client.CheckNativeAot
# rm -rf bin obj
# dotnet publish -r linux-x64 -c Release -o dist | tee output.txt
#
# # check for warnings
# grep -i warning output.txt && exit 1
#
# cd dist
# ls -lh
#
# # make sure it's executable
# file NATS.Client.CheckNativeAot
# file NATS.Client.CheckNativeAot | grep ELF || exit 1
#
# # can't be less than a meg
# ls --size NATS.Client.CheckNativeAot | perl -lne'/(\d+)/; exit(1) if $1 < 1024' || exit 1
#
# ./NATS.Client.CheckNativeAot
windows_test:
name: Windows
strategy:
fail-fast: false
matrix:
config:
# - branch: 'v2.9'
- branch: 'latest'
# - branch: 'main'
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
MSYS_NO_PATHCONV: 1
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Get nats-server
shell: bash
run: |
mkdir tools-nats-server && cd tools-nats-server
branch=$(curl https://api.mtmk.dev/gh/v1/releases/tag/nats-io/nats-server/${{ matrix.config.branch }})
curl -sL -o nats-server.exe "https://binaries.nats.dev/binary/github.com/nats-io/nats-server/v2?os=windows&arch=amd64&version=$branch"
cygpath -w "$(pwd)" | tee -a "$GITHUB_PATH"
- name: Check nats-server
run: nats-server -v
# - name: Get tools
# run: |
# Invoke-WebRequest https://download.jetbrains.com/resharper/JetBrains.dotMemoryUnit.3.2.20220510.zip -OutFile dotMemoryUnit.zip
# Expand-Archive dotMemoryUnit.zip
# $current_path = (Get-Item .).FullName
# echo "$current_path\dotMemoryUnit" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# dotnet tool install --global NUnit.ConsoleRunner.NetCore
- name: Build
run: |
dotnet build -c Release
# dotnet build -c Debug
# - name: Memory Test (net6.0)
# run: dotMemoryUnit $env:userprofile\.dotnet\tools\nunit.exe --propagate-exit-code -- .\tests\NATS.Client.Core.MemoryTests\bin\Release\net6.0\NATS.Client.Core.MemoryTests.dll
- name: Platform Test (Windows net481)
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests\NATS.Client.Platform.Windows.Tests
dotnet test -c Release --no-build --logger:"console;verbosity=normal" -f net481
# Not working on Windows reliably
# - name: Test Core (net6.0)
# run: dotnet test -c Debug -f net6.0 --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Core.Tests/NATS.Client.Core.Tests.csproj
#
# - name: Test Core (net8.0)
# run: dotnet test -c Debug -f net8.0 --no-build --logger:"console;verbosity=normal" tests/NATS.Client.Core.Tests/NATS.Client.Core.Tests.csproj
- name: Test Core2
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests/NATS.Client.Core2.Tests
dotnet test -c Release --no-build
- name: Test CoreUnit
run: |
tasklist | grep -i nats-server && taskkill -F -IM nats-server.exe
nats-server.exe -v
cd tests/NATS.Client.CoreUnit.Tests
dotnet test -c Release --no-build