| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This directory contains comprehensive testing for the ConfigHub cub CLI command analyzer.
./unit/test-cub-validator.shExpected: 39/39 tests pass
# Requires cub CLI and authentication
cub auth login
./integration/test-cub-validator-integration.shcd /path/to/devops-sdk
./cub-command-analyzer.sh /path/to/your/project/test/
├── README.md # This file
├── TEST-PLAN.md # Comprehensive test strategy
├── VALIDATION-RESULTS.md # Proof of correctness
├── lib/
│ └── cub-test-framework.sh # Validation functions
├── unit/
│ └── test-cub-validator.sh # Unit tests (39 tests)
├── integration/
│ └── test-cub-validator-integration.sh # Integration tests
└── strategies/
└── cub-tests.md # Testing documentation
test-data/ # Example metadata fixtures
├── README.md # Fixture documentation
├── metadata.json # Unit metadata template
└── space-metadata.json # Space metadata template
Core validation functions:
Tests validator against known inputs:
Results: 39/39 tests pass (100%)
Compares validator with actual cub CLI:
Requirements:
Production codebase analysis:
Analysis files: ../examples/*-cub-analysis.txt
The validator catches 7 common error patterns:
cub unit update --patch --space devcub unit update --patch '{"spec":{"replicas":3}}'cub unit apply --space dev --where '*'cub unit list --where "Data CONTAINS 'replicas'"cub unit list --where "Data.spec.replicas > 2"cub unit list --where "Slug = \"myunit\""cub unit apply myunitcub space create myspace --label app=test
cub space new-prefix
cub space list --jsoncub unit create myunit config.yaml --space dev
cub unit create myunit --space dev --upstream-unit base --upstream-space base
cub unit create --dest-space qa --space base --filter project/appcub unit update --patch --label version=2.0 --space dev
cub unit update --patch --upgrade --space stagingcub unit update myunit newdata.yaml --space dev
echo '{"spec":{"replicas":3}}' | cub unit update myunit --from-stdin --space dev
cub unit update myunit --filename newdata.yaml --space devcub function do --space dev --where "Slug = 'myunit'" set-replicas 3
cub function do --space dev set-image nginx nginx:1.21cub unit apply myunit --space dev
cub unit apply --space dev --where "Labels.layer = 'backend'"
cub unit apply --space dev --waitEvidence the validator is correct:
See: VALIDATION-RESULTS.md for detailed proof
name: Validate cub Commands
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run validator tests
run: |
./test/unit/test-cub-validator.sh#!/bin/bash
# .git/hooks/pre-commit
if ! ./test/unit/test-cub-validator.sh; then
echo "❌ Validator tests failed"
exit 1
fi
echo "✅ All tests passed"
exit 0./cub-command-analyzer.sh bin/install-base./cub-command-analyzer.sh bin/./cub-command-analyzer.sh /Users/alexis/traderx/# Find all failures
./cub-command-analyzer.sh project/ > analysis.txt
grep "[FAIL]" analysis.txt
# Find all warnings
grep "[WARN]" analysis.txt# Weekly validation
./cub-command-analyzer.sh /Users/alexis/microtraderx/ > /tmp/mtx-weekly.txt
./cub-command-analyzer.sh /Users/alexis/traderx/ > /tmp/tx-weekly.txt
# Compare with baseline
diff ../examples/microtraderx-cub-analysis.txt /tmp/mtx-weekly.txt
diff ../examples/traderx-cub-analysis.txt /tmp/tx-weekly.txtFor issues or questions:
This test suite proves the cub-command-analyzer is correct through:
Confidence level: HIGH - Ready for production use.
| Back | FazBrowse Home | New Git URL |