Add similarweb-analytics Docker sandbox skill
这个提交包含在:
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUNTIME_FIXTURE_DIR="$SCRIPT_DIR/tests/fixtures"
|
||||
OUTPUT_DIR="${1:-$SCRIPT_DIR/../tmp/test-output}"
|
||||
RUNNER="$SCRIPT_DIR/run_in_docker.sh"
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
echo "[1/4] Build image + self-test"
|
||||
"$RUNNER" --build --runtime-dir "$RUNTIME_FIXTURE_DIR" --output-dir "$OUTPUT_DIR" -- --self-test
|
||||
|
||||
echo "[2/4] Dry-run validation"
|
||||
"$RUNNER" --runtime-dir "$RUNTIME_FIXTURE_DIR" --output-dir "$OUTPUT_DIR" -- \
|
||||
--api visits-total \
|
||||
--domain amazon.com \
|
||||
--country world \
|
||||
--dry-run
|
||||
|
||||
echo "[3/4] Mock call writes output file"
|
||||
"$RUNNER" --runtime-dir "$RUNTIME_FIXTURE_DIR" --output-dir "$OUTPUT_DIR" -- \
|
||||
--api global-rank \
|
||||
--domain amazon.com \
|
||||
--mock-result \
|
||||
--output /data/mock-global-rank.json
|
||||
|
||||
test -f "$OUTPUT_DIR/mock-global-rank.json"
|
||||
|
||||
echo "[4/4] Fixture ApiClient end-to-end call writes output"
|
||||
"$RUNNER" --runtime-dir "$RUNTIME_FIXTURE_DIR" --output-dir "$OUTPUT_DIR" -- \
|
||||
--api traffic-by-country \
|
||||
--domain amazon.com \
|
||||
--start-date 2025-12 \
|
||||
--end-date 2026-02 \
|
||||
--limit 3 \
|
||||
--output /data/fixture-traffic-by-country.json
|
||||
|
||||
test -f "$OUTPUT_DIR/fixture-traffic-by-country.json"
|
||||
echo "All tests passed. Output dir: $OUTPUT_DIR"
|
||||
在新工单中引用
屏蔽一个用户