Repository navigation
76 lines (66 loc) · 2.95 KB
/
Copy pathreliability.yml
File metadata and controls
76 lines (66 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Reliability
# Tier 2: pull requests that touch storage or the dispatcher run a concurrency and restart subset per provider.
# Tier 3: nightly and on demand (run it before a release) run every scenario per provider.
# Tier 1 (InMemory, every pull request) is a job in ci.yml.
on:
pull_request:
branches: [develop, main]
paths:
- 'src/NexJob.Postgres/**'
- 'src/NexJob.SqlServer/**'
- 'src/NexJob.Redis/**'
- 'src/NexJob.MongoDB/**'
- 'src/NexJob/Internal/**'
- 'tests/NexJob.ReliabilityTests/**'
- '.github/workflows/reliability.yml'
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
# Least privilege: the token can only read; a job that needs more asks for it itself.
permissions:
contents: read
jobs:
reliability:
name: Reliability - ${{ matrix.provider }}
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
provider: [Postgres, SqlServer, Redis, Mongo]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
- name: Build
# The worker project references the tests and is started by the crash test as a separate process.
run: dotnet build tests/NexJob.ReliabilityTests.Worker --configuration Release
- name: Run reliability tests
env:
EVENT: ${{ github.event_name }}
PROVIDER: ${{ matrix.provider }}
run: |
if [ "$EVENT" = "pull_request" ]; then
FILTER="Category=Reliability.Distributed&(FullyQualifiedName~${PROVIDER}ConcurrencyTests|FullyQualifiedName~${PROVIDER}RecoveryTests|FullyQualifiedName~${PROVIDER}ContinuationTests|FullyQualifiedName~${PROVIDER}OrphanTests|FullyQualifiedName~${PROVIDER}CrashTests|FullyQualifiedName~${PROVIDER}LiveObjectTests|FullyQualifiedName~${PROVIDER}ConnectionTests|FullyQualifiedName~${PROVIDER}PoolTests|FullyQualifiedName~${PROVIDER}ConnectionObjectTests|FullyQualifiedName~${PROVIDER}QueuePrefixUpgradeTests|FullyQualifiedName~${PROVIDER}ReadReplicaControlTests)"
else
FILTER="Category=Reliability.Distributed&FullyQualifiedName~${PROVIDER}"
fi
echo "Filter: $FILTER"
dotnet test tests/NexJob.ReliabilityTests \
--no-build \
--configuration Release \
--verbosity normal \
--filter "$FILTER" \
--logger "trx;LogFileName=reliability-${PROVIDER}.trx" \
--blame-hang \
--blame-hang-timeout 5m
- name: Upload reliability test artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: reliability-${{ matrix.provider }}-artifacts
path: tests/NexJob.ReliabilityTests/TestResults/**/*.trx