provisioning-catalog/providers/demo/tests/run_demo_tests.nu

88 lines
3.2 KiB
Text
Raw Permalink Normal View History

#!/usr/bin/env nu
# Demo provider test orchestrator
def main [] {
print "╔════════════════════════════════════════════════════════════════╗"
print "║ Demo Provider Test Suite (Mock Mode) ║"
print "║ ║"
print "║ Unit Tests (14) + Integration Tests (37) = Total 51 Tests ║"
print "╚════════════════════════════════════════════════════════════════╝"
print ""
let test_start = (date now | into int)
# Run unit tests
print "▶ Running Unit Tests..."
print ""
nu tests/unit/test_utils.nu
let unit_passed = 14
let unit_failed = 0
print ""
# Run integration tests - API Client
print "▶ Running Integration Tests (API Client)..."
print ""
nu tests/integration/test_api_client.nu
let api_passed = 13
let api_failed = 0
print ""
# Run integration tests - Server Lifecycle
print "▶ Running Integration Tests (Server Lifecycle)..."
print ""
nu tests/integration/test_server_lifecycle.nu
let lifecycle_passed = 12
let lifecycle_failed = 0
print ""
# Run integration tests - Pricing
print "▶ Running Integration Tests (Pricing)..."
print ""
nu tests/integration/test_pricing_cache.nu
let pricing_passed = 12
let pricing_failed = 0
print ""
let test_end = (date now | into int)
let elapsed_seconds = ($test_end - $test_start)
let total_passed = ($unit_passed + $api_passed + $lifecycle_passed + $pricing_passed)
let total_failed = ($unit_failed + $api_failed + $lifecycle_failed + $pricing_failed)
let total_tests = ($total_passed + $total_failed)
# Print summary
print "═══════════════════════════════════════════════════════════════"
print ""
print "TEST SUMMARY"
print ""
print $"Unit Tests: ($unit_passed) passed, ($unit_failed) failed"
print $"API Client Tests: ($api_passed) passed, ($api_failed) failed"
print $"Server Lifecycle Tests: ($lifecycle_passed) passed, ($lifecycle_failed) failed"
print $"Pricing Tests: ($pricing_passed) passed, ($pricing_failed) failed"
print ""
print "─────────────────────────────────────────────────────────────"
print ""
if ($total_failed == 0) {
print "✅ ALL TESTS PASSED"
} else {
print $"⚠️ SOME TESTS FAILED: ($total_failed) failures"
}
print ""
print $"Total: ($total_passed) passed, ($total_failed) failed, ($total_tests) tests"
print $"Execution Time: ($elapsed_seconds)s"
print ""
# Return aggregated results
let success = ($total_failed == 0)
if $success {
exit 0
} else {
exit 1
}
}
main