Skip to content

Regression Tests #11086

Regression Tests

Regression Tests #11086

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