AnomalyDetector initialized in main() with periodic model updates. Anomaly events broadcast to dashboard WS as 'alert' messages via BroadcastAlert. GET /api/anomalies?since=24h lists recent events. POST /api/security/arm and /api/security/disarm manage security mode. GET /api/security/status returns armed state, learning progress, and 24h anomaly count. Arm/disarm state persisted to learning_state table and restored on restart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
75 lines
1.9 KiB
YAML
75 lines
1.9 KiB
YAML
name: E2E Tests
|
|
|
|
# Only triggers from Argo Workflows via spaxel-ci
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
argo_run_id:
|
|
description: 'Argo Workflow run ID that triggered this'
|
|
required: false
|
|
type: string
|
|
repository_dispatch:
|
|
types: [e2e-test-trigger]
|
|
|
|
# Note: This workflow is triggered by Argo Workflows (spaxel-ci) via repository_dispatch event.
|
|
# The Argo Workflow posts to GitHub's repository_dispatch API to trigger this workflow.
|
|
# Results are posted back as a bead comment via the Argo Workflow.
|
|
|
|
jobs:
|
|
e2e:
|
|
name: End-to-End Integration Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache-dependency-path: mothership/go.sum
|
|
|
|
- name: Build mothership
|
|
working-directory: mothership
|
|
run: go build -v ./cmd/mothership
|
|
|
|
- name: Build simulator
|
|
working-directory: mothership
|
|
run: go build -v -o /tmp/spaxel-sim ./cmd/sim
|
|
|
|
- name: Run e2e tests
|
|
working-directory: mothership
|
|
run: go test -v -timeout 90s ./tests/e2e/...
|
|
|
|
docker-e2e:
|
|
name: Docker E2E Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache-dependency-path: mothership/go.sum
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t spaxel-e2e:test .
|
|
|
|
- name: Build simulator
|
|
working-directory: mothership
|
|
run: go build -v -o /tmp/spaxel-sim ./cmd/sim
|
|
|
|
- name: Run shell-based e2e test with Docker
|
|
env:
|
|
MOTHERSHIP_IMAGE: spaxel-e2e:test
|
|
run: |
|
|
chmod +x tests/e2e/run.sh
|
|
cd mothership
|
|
../tests/e2e/run.sh
|