Skip to content

petrpinkas/config-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RHTAS Configuration Test Suite

A Ginkgo-based test suite for installing, verifying, and testing Red Hat Trusted Artifact Signer (RHTAS) configurations on OpenShift clusters.

Running Tests

Using Go Test (Recommended)

Run all tests:

go test -v ./test/... --ginkgo.v

Run a specific scenario by YAML filename:

go test -v ./test/... --ginkgo.v --ginkgo.focus "rhtas-basic-default.yaml"

Run multiple scenarios (use regex with OR):

go test -v ./test/... --ginkgo.v --ginkgo.focus "rhtas-(basic|simple)-default.yaml"

Run a specific scenario by scenario name:

go test -v ./test/... --ginkgo.v --ginkgo.focus "Scenario.*basic"

Run specific test group across all scenarios:

go test -v ./test/... --ginkgo.v --ginkgo.focus "Config Loading"

Skip a specific scenario:

go test -v ./test/... --ginkgo.v --ginkgo.skip "rhtas-simple-default.yaml"

Using Ginkgo CLI

Run all tests:

go run github.com/onsi/ginkgo/v2/ginkgo -v test/...

Run specific scenario (using focus):

go run github.com/onsi/ginkgo/v2/ginkgo --focus "Basic Scenario" -v test/...

Run from a specific test directory:

cd test/rhtas
go run github.com/onsi/ginkgo/v2/ginkgo -v

Note: If you have ginkgo installed in your PATH, you can use it directly:

ginkgo -v test/...

Dry Run Mode

For faster feedback during development, you can run tests in "dry run" mode. This mode:

  • ✅ Processes templates and configs
  • ✅ Validates configuration structure
  • ✅ Verifies placeholder replacement
  • ❌ Skips Kubernetes client initialization
  • ❌ Skips namespace creation
  • ❌ Skips actual CR installation
  • ❌ Skips readiness verification

Enable dry run mode:

DRY_RUN=true go test -v ./test/... --ginkgo.v

Or use 1 instead of true:

DRY_RUN=1 go test -v ./test/... --ginkgo.v

Dry run mode is useful for:

  • Testing template and config processing without OpenShift access
  • Fast validation of configuration changes
  • CI/CD pipelines that don't have cluster access
  • Local development and debugging

Common Ginkgo Flags

  • -v or --verbose: Verbose output
  • --focus <regex>: Run tests matching the regex
  • --skip <regex>: Skip tests matching the regex
  • --label-filter <expression>: Filter by labels (e.g., scenario=basic)
  • --until-it-fails: Keep running until a test fails
  • --repeat <n>: Run tests n times
  • --randomize-all: Randomize test execution order
  • --seed <n>: Set random seed for reproducible runs

Project Structure

  • pkg/ - Reusable packages (api, config, clients, kubernetes, installer, verifier)
  • test/rhtas/ - Main RHTAS test suite
  • scenarios/ - Test scenarios organized by subfolder (e.g., scenarios/basic/)

Scenarios

Tests are organized by scenario folders. Each scenario folder contains YAML configuration files that define the RHTAS setup to test.

  • scenarios/basic/ - Basic RHTAS configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published