Add test automation script scaffolds
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
IMAGE="${FLUTTER_DOCKER_IMAGE:-ghcr.io/cirruslabs/flutter:stable}"
|
||||
|
||||
docker run --rm \
|
||||
-u 0:0 \
|
||||
-v "$ROOT_DIR:/workspace" \
|
||||
-w /workspace/app \
|
||||
"$IMAGE" \
|
||||
sh -lc "flutter pub get && dart format lib test && chown -R 1000:1000 /workspace/app"
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
REPORT_DIR="${1:-$ROOT_DIR/reports/tdc114plus/$(date +%Y%m%d-%H%M%S)}"
|
||||
REPORT_FILE="$REPORT_DIR/release-report.md"
|
||||
|
||||
mkdir -p "$REPORT_DIR"
|
||||
|
||||
{
|
||||
echo "# tdc114plus release report"
|
||||
echo
|
||||
echo "Generated at: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
echo
|
||||
echo "## Git"
|
||||
echo
|
||||
echo '```text'
|
||||
git -C "$ROOT_DIR" status --short --branch
|
||||
echo
|
||||
git -C "$ROOT_DIR" log --oneline -n 10
|
||||
echo '```'
|
||||
echo
|
||||
echo "## Verification Checklist"
|
||||
echo
|
||||
echo "- [ ] ./scripts/format-dart.sh"
|
||||
echo "- [ ] ./scripts/quality-gate.sh"
|
||||
echo "- [ ] Android debug APK build"
|
||||
echo "- [ ] Login/search/detail/favorites smoke test"
|
||||
echo "- [ ] Token storage review"
|
||||
echo "- [ ] Personal data exposure review"
|
||||
} >"$REPORT_FILE"
|
||||
|
||||
echo "generated release report: $REPORT_FILE"
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
APP_DIR="$ROOT_DIR/app"
|
||||
|
||||
if [ -z "${TDC114_API_BASE:-}" ]; then
|
||||
echo "TDC114_API_BASE is required for integration tests." >&2
|
||||
echo "Example: TDC114_API_BASE=https://staging.example.com $0" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
if [ ! -d "$APP_DIR/integration_test" ]; then
|
||||
echo "integration test scaffold: $APP_DIR/integration_test does not exist yet." >&2
|
||||
echo "Add Flutter integration tests before enabling this script in CI." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
"$ROOT_DIR/scripts/flutter-docker.sh" test integration_test
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
PID_FILE="$ROOT_DIR/.tdc114plus-mock-server.pid"
|
||||
|
||||
case "${1:-}" in
|
||||
start)
|
||||
echo "mock-server scaffold: no mock API server has been implemented yet." >&2
|
||||
echo "Expected future command: start a local API-compatible mock server." >&2
|
||||
exit 2
|
||||
;;
|
||||
stop)
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
echo "mock-server scaffold: removing stale pid file $PID_FILE"
|
||||
rm -f "$PID_FILE"
|
||||
else
|
||||
echo "mock-server scaffold: no running mock server pid file found."
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
echo "mock-server scaffold: pid file exists at $PID_FILE"
|
||||
else
|
||||
echo "mock-server scaffold: not running."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
APP_DIR="$ROOT_DIR/app"
|
||||
|
||||
if [ ! -d "$APP_DIR" ]; then
|
||||
echo "app directory does not exist: $APP_DIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "perf smoke scaffold"
|
||||
echo "- app directory: $APP_DIR"
|
||||
echo "- dart files: $(find "$APP_DIR/lib" -name '*.dart' | wc -l)"
|
||||
echo "- test files: $(find "$APP_DIR/test" -name '*.dart' | wc -l)"
|
||||
echo "No runtime performance probe is implemented yet."
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
"$ROOT_DIR/scripts/flutter-docker.sh" analyze
|
||||
"$ROOT_DIR/scripts/flutter-docker.sh" test
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROFILE="all"
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--profile=*)
|
||||
PROFILE="${arg#--profile=}"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument: $arg" >&2
|
||||
echo "Usage: $0 [--profile=jailbreaker|social_engineer|poisoner|all]" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "redteam scaffold: profile=$PROFILE"
|
||||
echo "tdc114plus does not include LLM/AI inference in the current scope."
|
||||
echo "This script is reserved for future AI features or prompt-based workflows."
|
||||
exit 2
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
SOURCE_DIR="${1:-$ROOT_DIR/app/test/snapshots}"
|
||||
TARGET_DIR="${2:-$ROOT_DIR/reports/snapshots/$(date +%Y%m%d-%H%M%S)}"
|
||||
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
echo "snapshot source directory does not exist: $SOURCE_DIR" >&2
|
||||
echo "Create widget/integration snapshot output first, then rerun this script." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
cp -R "$SOURCE_DIR"/. "$TARGET_DIR"/
|
||||
echo "saved snapshots to $TARGET_DIR"
|
||||
Reference in New Issue
Block a user