Files
git.stella-ops.org/tests/cicd-templates/README.md
StellaOps Bot 907783f625 Add property-based tests for SBOM/VEX document ordering and Unicode normalization determinism
- Implement `SbomVexOrderingDeterminismProperties` for testing component list and vulnerability metadata hash consistency.
- Create `UnicodeNormalizationDeterminismProperties` to validate NFC normalization and Unicode string handling.
- Add project file for `StellaOps.Testing.Determinism.Properties` with necessary dependencies.
- Introduce CI/CD template validation tests including YAML syntax checks and documentation content verification.
- Create validation script for CI/CD templates ensuring all required files and structures are present.
2025-12-26 15:17:58 +02:00

80 lines
1.8 KiB
Markdown

# CI/CD Template Tests
This directory contains validation tests for the StellaOps CI/CD signing templates.
## Running Tests
```bash
# Run all validation tests
./validate-templates.sh
# Run with verbose output
bash -x validate-templates.sh
```
## Test Coverage
| Test Suite | Description |
|------------|-------------|
| File Existence | Verifies all template files exist |
| YAML Syntax | Validates YAML syntax using yq |
| Workflow Structure | Checks required fields in workflows |
| Documentation | Validates documentation content |
| Cross-Platform | Ensures consistent patterns across platforms |
| actionlint | GitHub Actions specific linting |
## Prerequisites
For full test coverage, install:
```bash
# yq - YAML processor
brew install yq # macOS
# or
apt-get install yq # Debian/Ubuntu
# actionlint - GitHub Actions linter
go install github.com/rhysd/actionlint/cmd/actionlint@latest
# or
brew install actionlint
```
## Templates Tested
### GitHub Actions
- `stellaops-sign.yml` - Reusable signing workflow
- `stellaops-verify.yml` - Reusable verification workflow
- Example workflows for containers, SBOMs, verdicts
### GitLab CI
- `.gitlab-ci-stellaops.yml` - Include-able templates
- `example-pipeline.gitlab-ci.yml` - Full pipeline example
### Gitea
- `release-keyless-sign.yml` - Release signing
- `deploy-keyless-verify.yml` - Deploy verification
## Expected Output
```
========================================
CI/CD Template Validation Tests
Sprint: SPRINT_20251226_004_BE
========================================
Checking required tools
✓ PASS: yq is installed
✓ PASS: actionlint is installed
Testing GitHub Actions templates exist
✓ PASS: .github/workflows/examples/stellaops-sign.yml exists
...
Test Summary
========================================
Passed: 25
Failed: 0
All tests passed!
```