Files
llm-intelligence/scripts/importer_smoke_gate_test.sh
phamnazage-jpg 0de4402a11 feat(import): add CoreHub pricing collector and importer
- coreshub_pricing_lib.go: CoreHub pricing data extraction and parsing
- import_coreshub_pricing.go: importer with dry_run support
- import_coreshub_pricing_test.go: unit tests for importer
- coreshub_pricing_sample.txt: test fixture
2026-05-22 07:33:13 +08:00

36 lines
989 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
set +e
FAIL_OUTPUT="$(CORESHUB_FIXTURE_PATH=/nonexistent bash scripts/verify_importer_smoke.sh 2>&1)"
FAIL_RC=$?
set -e
if [[ "$FAIL_RC" -eq 0 ]]; then
echo "expected verify_importer_smoke.sh to fail with invalid fixture"
exit 1
fi
printf '%s' "$FAIL_OUTPUT" | grep -q '\[FAIL\] importer_smoke=coreshub-fixture'
set +e
PASS_OUTPUT="$(bash scripts/verify_importer_smoke.sh 2>&1)"
PASS_RC=$?
set -e
if [[ "$PASS_RC" -eq 0 ]]; then
echo "expected current live ctyun smoke to fail before full gate"
exit 1
fi
printf '%s' "$PASS_OUTPUT" | grep -q '\[PASS\] importer_smoke=coreshub-fixture'
printf '%s' "$PASS_OUTPUT" | grep -q '\[PASS\] importer_smoke=coreshub-live'
printf '%s' "$PASS_OUTPUT" | grep -q '\[PASS\] importer_smoke=ctyun-fixture'
printf '%s' "$PASS_OUTPUT" | grep -q '\[FAIL\] importer_smoke=ctyun-live'
echo "importer_smoke_gate_test: PASS"