agentleFS
Microsoft AzureKnown publisherAzure/sap-automation-qa/skills/test-runner/SKILL.md

test-runner

Skill14 starsChanged 21 months agoMITView on GitHub

Execute STAF tests using sap_automation_qa.sh. Supports direct Ansible execution and API mode. Use when asked to run tests, execute configuration checks, or start HA tests on SAP systems. Triggered by "run test", "execute ha test", "start test", "run configuration check", "test my system", or "trigger test job".

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run tests directly via Ansible (no API server required).

    line 45
  2. Distinctive:

    Create a directory for ad-hoc log captures:

    line 113
  3. Very specific:

    When running configuration checks, use --test-type=ConfigurationChecks CLI flag or set TEST_TYPE=ConfigurationChecks in vars.yaml.

    line 154
  4. Distinctive:

    Before reporting test execution complete:

    line 260

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Runner

Executes STAF tests via the framework's sap_automation_qa.sh CLI. Supports two modes: direct Ansible execution and API-driven job management.

Locate Framework

This skill requires a trusted STAF checkout — a working tree the operator has verified out-of-band as either the official upstream (https://github.com/Azure/sap-automation-qa.git) or a fork of it, at a specific revision, with the framework marker ./scripts/sap_automation_qa.sh present. The operator must have verified both the source (upstream URL or fork URL) and the revision through a trusted out-of-band channel before running this skill, and must have cd-ed into that directory. If that state is not confirmed, stop and use the setup-guide skill first; it owns the setup workflow. Do not resume this skill until setup-guide (or the operator directly) confirms the checkout is trusted.

⚠️ This skill is guidance only. Do NOT modify any source code, scripts, or framework files. Only help the user by running test commands and interpreting output.

When to Use

TriggerAction
run test / execute ha testRun specific HA test cases
run configuration checkRun config validation
start test / test my systemDetermine and run appropriate tests
trigger test jobCreate API job
list running testsCheck job status via API
schedule testCreate cron schedule

Direct Execution Mode

Run tests directly via Ansible (no API server required).

Syntax

./scripts/sap_automation_qa.sh --test-groups=<GROUP> [--test-cases=[case1,case2]] [FLAGS]

Test Groups

GroupDescription
HA_DB_HANAHANA Database HA tests (15 cases)
HA_SCSSAP Central Services HA tests (13 cases)
BACKUP_DB_HANAAzure Backup for HANA (5 cases)

Flags

FlagDescription
-v / -vv / -vvvVerbosity level
--offlineRun offline validation (no live cluster)
--extra-vars='{...}'Pass extra variables as JSON

Parameter Overrides (override vars.yaml at runtime)

FlagDescription
--test-type=TYPESAPFunctionalTests or ConfigurationChecks
--system-config=NAMESystem configuration name
--functional-test-type=TYPEe.g., DatabaseHighAvailability
--auth-type=TYPESSHKEY or VMPASSWORD
--workspaces-dir=DIRWorkspaces directory (default: WORKSPACES)
--telemetry-destination=DESTazureloganalytics or azuredataexplorer
--identity-client-id=IDUser-assigned managed identity client ID

Examples

# Run all HANA HA tests
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA

# Run specific test cases
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config,primary-node-crash]

# Run SCS tests
./scripts/sap_automation_qa.sh --test-groups=HA_SCS

# Run Azure Backup tests
./scripts/sap_automation_qa.sh --test-groups=BACKUP_DB_HANA

# Run configuration checks (via CLI flag, no vars.yaml change needed)
./scripts/sap_automation_qa.sh --test-type=ConfigurationChecks --system-config=DEV-WEEU-SAP01-X00 --auth-type=SSHKEY

# Run specific config check type
./scripts/sap_automation_qa.sh --test-type=ConfigurationChecks --system-config=DEV-WEEU-SAP01-X00 --extra-vars='{"configuration_test_type":"Database"}'

# Offline HA validation (no cluster interaction)
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config-offline] --offline

# Verbose output
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config] -vv

Capturing Execution Logs

CLI Output Capture

Create a directory for ad-hoc log captures:

mkdir -p logs/

Capture stdout and stderr to a timestamped file while still printing to the terminal:

./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config] 2>&1 | tee logs/run_$(date +%Y%m%d_%H%M%S).log

Redirect all output silently to a file:

./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA 2>&1 > logs/run_$(date +%Y%m%d_%H%M%S).log

Automatic Framework Logs

The framework writes logs automatically during every execution:

Log TypePath
Structured results (JSON lines)WORKSPACES/SYSTEM/{name}/logs/{invocation_id}.log
Raw Ansible outputWORKSPACES/SYSTEM/{name}/logs/execution_{timestamp}.log

API Mode Logs

For API-driven runs, stream logs and events in real time:

# Tail the job log
./scripts/sap_automation_qa.sh job log --id <JOB_ID>

# Stream SSE events
./scripts/sap_automation_qa.sh job events --id <JOB_ID>

Configuration Check Types

When running configuration checks, use --test-type=ConfigurationChecks CLI flag or set TEST_TYPE=ConfigurationChecks in vars.yaml. Use --extra-vars to select a specific check type:

TypeDescription
allRun all configuration checks
DatabaseDatabase instance checks
CentralServiceInstancesSCS/ERS checks
ApplicationInstancesPAS/APP checks
WebDispatcherInstancesWeb Dispatcher checks
ObserverInstancesObserver checks

API Mode

Requires the FastAPI server running (Docker or local uvicorn).

Health Check

./scripts/sap_automation_qa.sh health

Workspace Management

# List all workspaces
./scripts/sap_automation_qa.sh workspace

# Get specific workspace
./scripts/sap_automation_qa.sh workspace --id <WORKSPACE_ID>

Job Management

# Create a job
./scripts/sap_automation_qa.sh job create --workspace <WS> --test-group <GROUP> [--test-ids id1,id2]

# List jobs
./scripts/sap_automation_qa.sh job list [--workspace <WS>] [--status running] [--active]

# Get job details
./scripts/sap_automation_qa.sh job get --id <JOB_ID>

# Get job log
./scripts/sap_automation_qa.sh job log --id <JOB_ID> [--tail N]

# Stream job events (SSE)
./scripts/sap_automation_qa.sh job events --id <JOB_ID>

# Cancel a job
./scripts/sap_automation_qa.sh job cancel --id <JOB_ID> [--reason "text"]

API test group names:

  • DatabaseHighAvailability (maps to HA_DB_HANA)
  • CentralServicesHighAvailability (maps to HA_SCS)
  • AzureBackupDatabase (maps to BACKUP_DB_HANA)

Schedule Management

# Create schedule
./scripts/sap_automation_qa.sh schedule create --name "Nightly HA" --cron "0 2 * * *" --workspaces WS1[,WS2]

# List schedules
./scripts/sap_automation_qa.sh schedule list

# Get schedule details
./scripts/sap_automation_qa.sh schedule get --id <SCHEDULE_ID>

# Update schedule
./scripts/sap_automation_qa.sh schedule update --id <SCHEDULE_ID> [--cron "..."] [--enabled true]

# Delete schedule
./scripts/sap_automation_qa.sh schedule delete --id <SCHEDULE_ID>

# Trigger immediately
./scripts/sap_automation_qa.sh schedule trigger --id <SCHEDULE_ID>

# View schedule job history
./scripts/sap_automation_qa.sh schedule jobs --id <SCHEDULE_ID> [--limit N]

Test Catalog

Full test case reference: references/test-catalog.md

Output Locations

Result file paths (JSON lines log, Ansible execution log, HTML report) are canonical in the test-result-analyzer skill; see its ## Result File Locations section.

Error Handling

ErrorCauseFix
Workspace not foundInvalid SYSTEM_CONFIG_NAME in vars.yamlCheck workspace exists
SSH connection failedAuth or network issueValidate SSH key, check connectivity
vars.yaml not foundMissing configCreate vars.yaml at project root or use CLI flags
API not reachableServer not runningStop this skill and invoke setup-guide to start or restore the API/container. setup-guide owns the setup workflow; do not run setup.sh, docker compose, or any container-start command from this skill. Resume this skill only after setup-guide (or the operator directly) confirms the API is reachable.
Job already runningWorkspace lockedWait for completion or cancel existing job
Test case not foundInvalid test-case nameCheck test-catalog.md for valid names

Pre-Completion Checklist

Before reporting test execution complete:

  • Correct test group and cases selected for the scenario
  • vars.yaml configured with correct SYSTEM_CONFIG_NAME
  • Workspace validated (sap-parameters.yaml + hosts.yaml + SSH)
  • Test completed (check exit code or job status)
  • Results available in logs directory

Related Skills

Need to...Use skill
Set up environment firstsetup-guide
Create a workspaceworkspace-creator
Validate workspace before runningworkspace-validator
Analyze test resultstest-result-analyzer

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.