Skip to content

Nightly test metrics #7

Nightly test metrics

Nightly test metrics #7

name: Nightly test metrics
# Once a day, run the Lettuce test suite (main branch, single
# configuration) against the current stable Redis test image and report
# per-test durations to Grafana for performance regression tracking.
on:
schedule:
- cron: '30 4 * * *' # nightly, staggered from the 01:00 CI and benchmark runs
workflow_dispatch:
concurrency:
group: nightly-metrics
cancel-in-progress: false
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
nightly-metrics:
name: Redis 8.10; test metrics
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
# Secrets can't be used in `if:` conditions, so a first step checks
# the token and later steps are gated on its output. Without the
# secret the job prints a warning and skips everything.
- name: Check for the metrics token
id: gate
env:
OTEL_TOKEN: ${{ secrets.OTEL_CI_VISIBILITY_TOKEN }}
run: |
if [ -z "$OTEL_TOKEN" ]; then
echo "::warning::The OTEL_CI_VISIBILITY_TOKEN secret is not set; skipping the nightly metrics run."
echo "run=false" >> "$GITHUB_OUTPUT"
else
echo "run=true" >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
if: steps.gate.outputs.run == 'true'
uses: actions/checkout@v6
- name: Set up Java
if: steps.gate.outputs.run == 'true'
uses: actions/setup-java@v5
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Setup Maven
if: steps.gate.outputs.run == 'true'
uses: s4u/setup-maven-action@v1.19.0
with:
checkout-enabled: false
java-version: '8'
- name: Set up Docker Compose environment
if: steps.gate.outputs.run == 'true'
run: make start version=8.10
- name: Run tests
if: steps.gate.outputs.run == 'true'
run: make test
env:
JVM_OPTS: -Xmx3200m
TERM: dumb
- name: Tear down Docker Compose environment
if: always() && steps.gate.outputs.run == 'true'
run: make stop version=8.10
continue-on-error: true
# Surefire (unit tests) and failsafe (integration tests) write their
# JUnit XML reports to separate folders; the metrics action reads one.
- name: Collect JUnit XML reports
if: ${{ !cancelled() && steps.gate.outputs.run == 'true' }}
run: |
mkdir -p test-results
cp target/surefire-reports/TEST-*.xml target/failsafe-reports/TEST-*.xml test-results/
- name: Report test metrics
# Report even when tests fail, but not when the run was cancelled.
if: ${{ !cancelled() && steps.gate.outputs.run == 'true' }}
uses: redis-developer/cae-otel-ci-visibility@v4
with:
junit-xml-folder: 'test-results'
otlp-endpoint: 'https://otlp-gateway-prod-us-central-0.grafana.net/otlp/v1/metrics'
otlp-headers: 'Authorization=Basic ${{ secrets.OTEL_CI_VISIBILITY_TOKEN }}'
server-version: '8.10'