This repository has been archived on 2026-11-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
e4a93c8826
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / android-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-mcp (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 9s
QRun-IO/ci-policy: Shared source and config CI / verify (pull_request) Successful in 21s
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
QRun-IO/ci-policy: Shared source and config CI / secrets (pull_request) Successful in 24s
QRun-IO/ci-policy: Shared source and config CI / gate (pull_request) Successful in 14s
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Successful in 39s
QRun-IO/ci-policy: ci / ci-result (pull_request) Successful in 6s
fix: use self-supporting PostgreSQL consumer acceptance
Use the existing Docker PostgreSQL fixture instead of the removed MySQL caller. Regenerate the packed resource and preserve all source identity and coverage gates. Orb validation and all 56 generator regressions pass on Linux.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Co-Authored-By: Codex <noreply@openai.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-02 16:18:47 -06:00
..

Calculate Version Script Test Suite

This directory contains comprehensive tests for the calculate_version.sh script.

Test Files

  • test_calculate_version.sh - Main test suite with comprehensive test cases
  • run_tests.sh - Test runner with different output modes
  • README.md - This documentation

Running Tests

Quick Test Run

./tests/run_tests.sh

Verbose Test Run

./tests/run_tests.sh --verbose

CI Mode (minimal output)

./tests/run_tests.sh --ci

Direct Test Suite

./tests/test_calculate_version.sh
./tests/test_calculate_version.sh --verbose

Test Coverage

The test suite covers:

Branch Types

  • Main Branch: Tests stable version handling, tag detection, RC conversion
  • Develop Branch: Tests SNAPSHOT version management, release detection
  • Release Branch: Tests RC version creation and incrementing
  • Hotfix Branch: Tests patch version bumping
  • Feature Branch: Tests version inheritance

Edge Cases

  • Invalid branch formats
  • Unknown branch types
  • Missing tags on main branch
  • Various version formats (stable, SNAPSHOT, RC)

Version Parsing

  • Standard versions: 1.0.0
  • SNAPSHOT versions: 1.0.0-SNAPSHOT
  • RC versions: 1.0.0-RC.1, 1.0.0-RC.10
  • Multi-digit versions: 10.20.30

Test Environment

The test suite:

  1. Creates a temporary test directory
  2. Initializes a test git repository
  3. Creates test pom.xml files with different versions
  4. Creates test branches and tags
  5. Runs the calculate_version.sh script
  6. Validates the output
  7. Cleans up test data

Integration with Make

The tests are integrated into the Makefile and can be run with:

make test-scripts

Test Results

The test suite provides:

  • ✅ Pass/fail status for each test
  • 📊 Summary statistics
  • 🔍 Detailed output in verbose mode
  • 🚫 Clean exit codes for CI integration

Adding New Tests

To add new test cases:

  1. Add a new test function in test_calculate_version.sh
  2. Call run_test with appropriate parameters:
    run_test "Test Name" "branch_name" "current_version" "expected_version" "tag_name"
    
  3. Add the test function to the main execution flow
  4. Update this README if needed

Troubleshooting

Common Issues

  1. Permission denied: Make sure test scripts are executable

    chmod +x tests/*.sh
    
  2. Git not found: Ensure git is installed and available in PATH

  3. Test failures: Run with --verbose to see detailed output

    ./tests/run_tests.sh --verbose
    

Debug Mode

For debugging, you can run individual test functions by modifying the main function in test_calculate_version.sh to call only specific test functions.