-
Notifications
You must be signed in to change notification settings - Fork 1.2k
167 lines (152 loc) · 6.58 KB
/
Copy pathregression-tests.yml
File metadata and controls
167 lines (152 loc) · 6.58 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Regression Tests
on:
schedule:
- cron: "0 0/3 * * *"
workflow_dispatch:
inputs:
# Pytest inputs.
test-suites:
description: "Pytest: optional filenames; empty runs all Pytest suites. See .github/REGRESSION-TESTS.md. Example: connection_test,eval_test"
required: false
default: ""
type: string
test-cases:
description: "Pytest: optional node ID regex; See .github/REGRESSION-TESTS.md. Example: test_golang_asynq_script|test_shared_read_buffer_overflow_copy_metric"
required: false
default: ""
type: string
iterations:
description: "Pytest: optional number of iterations. See .github/REGRESSION-TESTS.md. Default: 1. Example: 12"
required: false
default: "1"
type: string
# GoogleTest inputs.
gtest-suites:
description: "GoogleTest: manual runs only; optional targets, empty runs every target. See .github/REGRESSION-TESTS.md. Example: dfly_core_test,redis_parser_test"
required: false
default: ""
type: string
gtest-cases:
description: "GoogleTest: optional --gtest_filter; See .github/REGRESSION-TESTS.md. Example: StringMapTest.*:DashTest.*"
required: false
default: ""
type: string
gtest-iterations:
description: "GoogleTest: optional number of iterations. See .github/REGRESSION-TESTS.md. Default: 1. Example: 12"
required: false
default: "1"
type: string
# Common inputs.
max-run-time:
description: "Common: combined time limit (minutes) for the build/Pytest/GoogleTest runs; Default: 360"
required: false
default: "360"
type: string
continue-on-test-failure:
description: "Common: failure handling for Pytest and GoogleTest; true completes iterations, archives failed Pytest logs, and deletes clean logs. See .github/REGRESSION-TESTS.md"
required: false
default: false
type: boolean
jobs:
build:
if: github.repository == 'dragonflydb/dragonfly'
strategy:
fail-fast: ${{ github.event_name != 'workflow_dispatch' || !inputs.continue-on-test-failure }}
matrix:
# Test of these containers
container: ["ubuntu-dev:24"]
proactor: [Uring]
build-type: [Debug, Release]
runner: [ubuntu-latest, [self-hosted, linux, ARM64]]
enable_resp_io_loop_v2: [false, true]
runs-on: ${{ matrix.runner }}
timeout-minutes: "${{ fromJSON(github.event_name == 'workflow_dispatch' && '360' || '80') }}"
permissions:
id-token: write
contents: read
actions: write # To allow deleting cache
container:
image: ghcr.io/romange/${{ matrix.container }}
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
volumes:
- /var/crash:/var/crash
- /:/hostroot
- /mnt:/mnt
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Validate manual regression inputs
if: github.event_name == 'workflow_dispatch'
shell: bash
run: .github/scripts/run-regression-tests-helper.sh validate
env:
ITERATIONS_INPUT: ${{ inputs.iterations || '1' }}
TEST_SUITES_INPUT: ${{ inputs.test-suites || '' }}
TEST_CASES_INPUT: ${{ inputs.test-cases || '' }}
GTEST_SUITES_INPUT: ${{ inputs.gtest-suites || '' }}
GTEST_ITERATIONS_INPUT: ${{ inputs.gtest-iterations || '' }}
MAX_RUN_TIME_INPUT: ${{ inputs.max-run-time || '' }}
CONTINUE_ON_TEST_FAILURE_INPUT: ${{ inputs.continue-on-test-failure || 'false' }}
- name: Start shared regression time budget
shell: bash
env:
MAX_RUN_TIME_MINUTES: ${{ github.event_name == 'workflow_dispatch' && (inputs.max-run-time || '360') || '80' }}
run: |
echo "Shared regression time budget: ${MAX_RUN_TIME_MINUTES} minutes (build, Pytest, and GoogleTest)"
echo "REGRESSION_DEADLINE_EPOCH=$(( $(date +%s) + MAX_RUN_TIME_MINUTES * 60 ))" >> "$GITHUB_ENV"
- name: Print environment info
run: |
cat /proc/cpuinfo
ulimit -a
env
lsblk -l
- name: Build Dragonfly
uses: ./.github/actions/builder
with:
enable-ccache: 'true'
ccache-save: 'true'
enable-deps-cache: 'true'
build-type: ${{matrix.build-type}}
cache-key-suffix: 'df_common_bin'
c-compiler: gcc
cxx-compiler: g++
targets: 'dragonfly'
- name: Authenticate to AWS
if: github.repository_owner == 'dragonflydb' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_CI_S3_ROLE_ARN }}
aws-region: us-east-1
- name: Run regression tests action
uses: ./.github/actions/regression-tests
with:
dfly-executable: dragonfly
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
build-folder-name: build
filter: ${{ matrix.build-type == 'Release' && 'not debug_only' || 'not opt_only' }}
test-suites: ${{ inputs.test-suites || '' }}
test-cases: ${{ inputs.test-cases || '' }}
iterations: ${{ inputs.iterations || '1' }}
max-run-time: ${{ github.event_name == 'workflow_dispatch' && (inputs.max-run-time || '360') || '80' }}
gtest-suites: ${{ inputs.gtest-suites || '' }}
gtest-cases: ${{ inputs.gtest-cases || '' }}
gtest-iterations: ${{ inputs.gtest-iterations || '' }}
continue-on-test-failure: ${{ inputs.continue-on-test-failure || 'false' }}
test-only-failure-iterations: ${{ github.event_name == 'workflow_dispatch' && '1,3' || '' }}
df-runtime-flags: enable_resp_io_loop_v2=${{ matrix.enable_resp_io_loop_v2 }}
s3-bucket: ${{ secrets.S3_REGTEST_BUCKET }}
junit-s3-bucket: ${{ secrets.S3_REGTEST_BUCKET }}
aws-role-to-assume: ${{ secrets.AWS_CI_S3_ROLE_ARN }}
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: regression-logs-${{ matrix.proactor }}-${{ matrix.build-type }}-${{ matrix.enable_resp_io_loop_v2 }}-${{ runner.arch }}
path: /tmp/regression-failed/*
lint-test-chart:
if: github.repository == 'dragonflydb/dragonfly'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/lint-test-chart