Files
git.stella-ops.org/.gitea/workflows/hlc-distributed.yml

216 lines
7.0 KiB
YAML

# HLC Distributed Tests Workflow
# Sprint: Testing Enhancement Advisory - Phase 1.2
# Tests multi-node HLC scenarios with network partition simulation
name: hlc-distributed
on:
schedule:
# Run nightly at 2 AM UTC
- cron: '0 2 * * *'
push:
branches: [main]
paths:
- 'src/__Libraries/StellaOps.HybridLogicalClock/**'
- 'src/__Tests/Integration/StellaOps.Integration.HLC/**'
pull_request:
paths:
- 'src/__Libraries/StellaOps.HybridLogicalClock/**'
- 'src/__Tests/Integration/StellaOps.Integration.HLC/**'
workflow_dispatch:
inputs:
run_extended:
description: 'Run extended multi-node tests'
type: boolean
default: false
run_chaos:
description: 'Run chaos/partition tests'
type: boolean
default: true
concurrency:
group: hlc-distributed-${{ github.ref }}
cancel-in-progress: true
jobs:
# ==========================================================================
# Multi-Node HLC Tests
# ==========================================================================
hlc-distributed:
name: Distributed HLC Tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.100"
- name: Restore dependencies
run: dotnet restore src/__Tests/Integration/StellaOps.Integration.HLC/StellaOps.Integration.HLC.csproj
- name: Build HLC tests
run: dotnet build src/__Tests/Integration/StellaOps.Integration.HLC/StellaOps.Integration.HLC.csproj --configuration Release --no-restore
- name: Run distributed HLC tests
run: |
dotnet test src/__Tests/Integration/StellaOps.Integration.HLC \
--configuration Release \
--no-build \
--filter "Category=HLC&Category=Integration" \
--logger "trx;LogFileName=hlc-distributed.trx" \
--results-directory ./TestResults
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: hlc-distributed-results
path: TestResults/**
- name: Publish test summary
uses: dorny/test-reporter@v1
if: always()
with:
name: HLC Distributed Test Results
path: TestResults/**/*.trx
reporter: dotnet-trx
# ==========================================================================
# Network Partition / Chaos Tests
# ==========================================================================
hlc-chaos:
name: HLC Chaos Tests
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.100"
- name: Restore dependencies
run: dotnet restore src/__Tests/Integration/StellaOps.Integration.HLC/StellaOps.Integration.HLC.csproj
- name: Build HLC tests
run: dotnet build src/__Tests/Integration/StellaOps.Integration.HLC/StellaOps.Integration.HLC.csproj --configuration Release --no-restore
- name: Run partition tests
run: |
dotnet test src/__Tests/Integration/StellaOps.Integration.HLC \
--configuration Release \
--no-build \
--filter "Category=Chaos" \
--logger "trx;LogFileName=hlc-chaos.trx" \
--results-directory ./TestResults
- name: Run extended multi-node tests
if: github.event.inputs.run_extended == 'true'
run: |
dotnet test src/__Tests/Integration/StellaOps.Integration.HLC \
--configuration Release \
--no-build \
--filter "FullyQualifiedName~LargeCluster|FullyQualifiedName~HighFrequency" \
--logger "trx;LogFileName=hlc-extended.trx" \
--results-directory ./TestResults
- name: Upload chaos test results
uses: actions/upload-artifact@v4
if: always()
with:
name: hlc-chaos-results
path: TestResults/**
- name: Publish test summary
uses: dorny/test-reporter@v1
if: always()
with:
name: HLC Chaos Test Results
path: TestResults/**/*.trx
reporter: dotnet-trx
# ==========================================================================
# Determinism Verification
# ==========================================================================
hlc-determinism:
name: HLC Determinism Verification
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.100"
- name: Restore dependencies
run: dotnet restore src/__Libraries/__Tests/StellaOps.HybridLogicalClock.Tests/StellaOps.HybridLogicalClock.Tests.csproj
- name: Build HLC unit tests
run: dotnet build src/__Libraries/__Tests/StellaOps.HybridLogicalClock.Tests/StellaOps.HybridLogicalClock.Tests.csproj --configuration Release --no-restore
- name: Run determinism verification (3 runs)
run: |
for i in 1 2 3; do
echo "=== Run $i ==="
dotnet test src/__Libraries/__Tests/StellaOps.HybridLogicalClock.Tests \
--configuration Release \
--no-build \
--filter "FullyQualifiedName~Monotonic|FullyQualifiedName~Uniqueness" \
--logger "trx;LogFileName=hlc-determinism-$i.trx" \
--results-directory ./TestResults/run-$i
done
- name: Compare determinism runs
run: |
echo "Comparing test results across runs..."
# All runs should pass
for i in 1 2 3; do
if [ ! -f "./TestResults/run-$i/hlc-determinism-$i.trx" ]; then
echo "Run $i results not found"
exit 1
fi
done
echo "All determinism runs completed successfully"
- name: Upload determinism results
uses: actions/upload-artifact@v4
if: always()
with:
name: hlc-determinism-results
path: TestResults/**
# ==========================================================================
# Gate Status
# ==========================================================================
gate-status:
name: HLC Distributed Gate Status
runs-on: ubuntu-latest
needs: [hlc-distributed, hlc-determinism]
if: always()
steps:
- name: Check gate status
run: |
if [ "${{ needs.hlc-distributed.result }}" == "failure" ]; then
echo "::error::Distributed HLC tests failed"
exit 1
fi
if [ "${{ needs.hlc-determinism.result }}" == "failure" ]; then
echo "::error::HLC determinism verification failed"
exit 1
fi
echo "All HLC distributed checks passed!"