Repository navigation
111 lines (98 loc) · 4.45 KB
/
Copy pathsample-ha-longhaul.yml
File metadata and controls
111 lines (98 loc) · 4.45 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Sample HA Long-Haul Test
# Long-haul high-availability soak of the redundant sample applications
# (RedundantServer / RedundantClient / RedundantPubSub). These tests are marked
# [Explicit] so the normal CI workflow never runs them; the short-haul variants
# of the same scenarios run there automatically.
#
# Run on demand (Actions -> Sample HA Long-Haul Test -> Run workflow) and choose
# the duration, or let the weekly schedule exercise the default one-hour soak.
# Pull requests labelled 'soak' run a 15-minute-per-scenario soak; it is not a
# required check. Adding the label starts a run; every later push to the
# labelled pull request starts a new one and cancels the run in progress.
on:
workflow_dispatch:
inputs:
duration:
description: 'High-availability soak duration in minutes'
required: false
default: '60'
type: string
schedule:
# Weekly, Sunday 04:00 UTC (after the nightly build/stress windows).
- cron: '0 4 * * 0'
pull_request:
types: [labeled, synchronize, opened, reopened]
permissions:
contents: read
# A pull request run is superseded by the next push. A 'labeled' event for any
# other label gets a group of its own so it cannot cancel a run in progress.
concurrency:
group: ${{ github.workflow }}-${{ github.event.action == 'labeled' && github.event.label.name != 'soak' && github.run_id || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
sample-ha-longhaul:
name: Sample HA Long-Haul (${{ github.event_name == 'pull_request' && '15' || github.event.inputs.duration || '60' }} min/scenario)
# On a pull request only when it carries the 'soak' label, and not again
# when some other label is added to it.
if: >-
github.event_name != 'pull_request' ||
(contains(github.event.pull_request.labels.*.name, 'soak') &&
(github.event.action != 'labeled' || github.event.label.name == 'soak'))
runs-on: ubuntu-latest
# SAMPLE_HA_DURATION_MINUTES is the soak length of *each* scenario, and the
# fixture is [NonParallelizable], so the two soaks (PubSubFailoverSoakAsync
# and ClientReconnectSoakAsync) run back to back: the floor is 2 x duration,
# plus each test's own teardown head-room (5 and 10 minutes) before its
# CancellationTokenSource fires. The previous 110/120-minute budgets were
# below that floor for the default 60-minute duration, so the weekly
# schedule could never pass - it always tripped the step timeout. Keep the
# budgets above 2 x duration + teardown + build.
timeout-minutes: 180
env:
TARGET_FRAMEWORK: 'net10.0'
CONFIGURATION: 'Release'
TESTPROJECT: './tests/Opc.Ua.Redundancy.Samples.Tests/Opc.Ua.Redundancy.Samples.Tests.csproj'
SAMPLE_HA_DURATION_MINUTES: ${{ github.event_name == 'pull_request' && '15' || github.event.inputs.duration || '60' }}
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup .NET from global.json
uses: ./.github/actions/setup-repository-dotnet
with:
dotnet-version: 10.0.x
- name: Set Cloud Version
shell: pwsh
run: ./.azurepipelines/set-version.ps1
- name: Restore dependencies
run: dotnet restore 'UA.slnx'
- name: Build sample HA tests (and the referenced sample apps)
run: >
dotnet build ${{ env.TESTPROJECT }}
--framework ${{ env.TARGET_FRAMEWORK }}
--configuration ${{ env.CONFIGURATION }}
--no-restore
/p:CustomTestTarget=${{ env.TARGET_FRAMEWORK }}
- name: Run long-haul HA soak
run: |
echo "Running the sample HA long-haul soak for $SAMPLE_HA_DURATION_MINUTES minute(s) per scenario."
dotnet test ${{ env.TESTPROJECT }} \
--configuration ${{ env.CONFIGURATION }} \
--no-build \
--framework ${{ env.TARGET_FRAMEWORK }} \
/p:CustomTestTarget=${{ env.TARGET_FRAMEWORK }} \
--filter "Category=SampleHaLongHaul" \
--logger "trx;LogFileName=sample-ha-longhaul.trx" \
--logger "console;verbosity=detailed" \
--results-directory ./TestResults
timeout-minutes: 150
- name: Check that the long-haul tests ran
shell: pwsh
run: ./.github/scripts/assert-tests-ran.ps1 -ResultsDirectory ./TestResults
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: sample-ha-longhaul-results
path: ./TestResults
if: always()