High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
ci: add fail-fast recent E2E workflow and better failure logs
Luigi Agostid0b9e3f2a8cb
diff --git a/.github/workflows/e2e-cli.yml b/.github/workflows/e2e-cli.ymldeleted file mode 100644index 158d3bf9..00000000--- a/.github/workflows/e2e-cli.yml+++ /dev/null@@ -1,128 +0,0 @@-name: E2E CLI Tests--permissions:- contents: read--on:- workflow_dispatch:- push:- branches: [main]- paths:- - 'cmd/**'- - 'internal/**'- - 'tests/e2e/**'- - '.github/workflows/e2e-cli.yml'- pull_request:- branches: [main]- paths:- - 'cmd/**'- - 'internal/**'- - 'tests/e2e/**'- - '.github/workflows/e2e-cli.yml'--env:- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true--jobs:- e2e-cli:- name: CLI End-to-End Tests- runs-on: ubuntu-latest- env:- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true- steps:- - name: Checkout- uses: actions/checkout@v4-- - name: Set up Go- uses: actions/setup-go@v5- with:- go-version: '1.24'- cache: false-- - name: Build pinchtab binary- run: |- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o tests/e2e/runner-cli/pinchtab ./cmd/pinchtab-- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v3-- - name: Run CLI E2E tests- id: e2e- working-directory: tests/e2e- run: |- set +e- docker compose -f docker-compose-cli.yml up \- --build \- --abort-on-container-exit \- --exit-code-from runner 2>&1 | tee e2e-output.log- EXIT_CODE=${PIPESTATUS[0]}-- # Extract summary from logs- PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")- FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")-- # Get failed test names if any- FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)-- echo "passed=$PASSED" >> $GITHUB_OUTPUT- echo "failed=$FAILED" >> $GITHUB_OUTPUT- echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT-- # Save failures for multiline output- {- echo 'failures<<EOF'- echo "$FAILURES"- echo 'EOF'- } >> $GITHUB_OUTPUT-- exit $EXIT_CODE-- - name: Copy results from container- if: always()- working-directory: tests/e2e- run: |- docker compose -f docker-compose-cli.yml cp runner:/results ./results || true-- - name: Post summary- if: always()- run: |- if [ "${{ steps.e2e.outputs.failed }}" = "0" ]; then- echo "## ✅ CLI E2E Tests Passed" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "**${{ steps.e2e.outputs.passed }}** tests passed" >> $GITHUB_STEP_SUMMARY- else- echo "## ❌ CLI E2E Tests Failed" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "**Passed:** ${{ steps.e2e.outputs.passed }}" >> $GITHUB_STEP_SUMMARY- echo "**Failed:** ${{ steps.e2e.outputs.failed }}" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "### Failed tests:" >> $GITHUB_STEP_SUMMARY- echo '```' >> $GITHUB_STEP_SUMMARY- echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY- echo '```' >> $GITHUB_STEP_SUMMARY- fi-- - name: Report check annotation- if: always()- run: |- PASSED="${{ steps.e2e.outputs.passed }}"- FAILED="${{ steps.e2e.outputs.failed }}"- FAILURES="${{ steps.e2e.outputs.failures }}"-- if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then- echo "::notice title=CLI E2E Tests::✅ ${PASSED:-All} tests passed"- else- echo "::error title=CLI E2E Tests::❌ ${FAILED} failed, ${PASSED} passed"- # Log each failure as warning- echo "$FAILURES" | while read -r line; do- [ -n "$line" ] && echo "::warning::$line"- done- fi-- - name: Upload results- if: always()- uses: actions/upload-artifact@v4- with:- name: cli-e2e-results- path: tests/e2e/results/- retention-days: 7diff --git a/.github/workflows/e2e-curl.yml b/.github/workflows/e2e-curl.ymldeleted file mode 100644index 0f1380ff..00000000--- a/.github/workflows/e2e-curl.yml+++ /dev/null@@ -1,142 +0,0 @@-name: E2E Curl Tests--permissions:- contents: read--on:- push:- branches: [main]- paths-ignore:- - '**.md'- - 'docs/**'- - 'LICENSE'- - '.gitignore'- - 'skill/**'- - 'plugin/**'- pull_request:- branches: [main]- paths-ignore:- - '**.md'- - 'docs/**'- - 'LICENSE'- - '.gitignore'- - 'skill/**'- - 'plugin/**'- workflow_dispatch:- inputs:- branch:- description: 'Branch to test (leave empty for current)'- required: false- default: ''- debug:- description: 'Enable debug logging'- required: false- default: 'false'--env:- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true--jobs:- e2e:- name: E2E Curl Tests- runs-on: ubuntu-latest- if: github.event_name != 'pull_request' || github.event.pull_request.draft == false- timeout-minutes: 15- env:- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true-- steps:- - name: Checkout- uses: actions/checkout@v4- with:- ref: ${{ inputs.branch || github.ref }}-- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v3-- - name: Run E2E tests- id: e2e- run: |- set +e- mkdir -p tests/e2e/results- docker compose -f tests/e2e/docker-compose.yml up \- --build \- --abort-on-container-exit \- --exit-code-from runner 2>&1 | tee e2e-output.log- EXIT_CODE=${PIPESTATUS[0]}-- # Extract summary from logs- PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")- FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")-- # Get failed test names if any- FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)-- echo "passed=$PASSED" >> $GITHUB_OUTPUT- echo "failed=$FAILED" >> $GITHUB_OUTPUT- echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT-- {- echo 'failures<<EOF'- echo "$FAILURES"- echo 'EOF'- } >> $GITHUB_OUTPUT-- exit $EXIT_CODE- env:- DOCKER_BUILDKIT: 1- COMPOSE_DOCKER_CLI_BUILD: 1-- - name: Copy results from container- if: always()- run: |- docker cp $(docker ps -aq -f name=e2e-runner):/results/. tests/e2e/results/ 2>/dev/null || true- ls -la tests/e2e/results/ || true-- - name: Post summary- if: always()- run: |- if [ "${{ steps.e2e.outputs.failed }}" = "0" ]; then- echo "## ✅ E2E Curl Tests Passed" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "**${{ steps.e2e.outputs.passed }}** tests passed" >> $GITHUB_STEP_SUMMARY- else- echo "## ❌ E2E Curl Tests Failed" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "**Passed:** ${{ steps.e2e.outputs.passed }}" >> $GITHUB_STEP_SUMMARY- echo "**Failed:** ${{ steps.e2e.outputs.failed }}" >> $GITHUB_STEP_SUMMARY- echo "" >> $GITHUB_STEP_SUMMARY- echo "### Failed tests:" >> $GITHUB_STEP_SUMMARY- echo '```' >> $GITHUB_STEP_SUMMARY- echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY- echo '```' >> $GITHUB_STEP_SUMMARY- fi-- - name: Report check annotation- if: always()- run: |- PASSED="${{ steps.e2e.outputs.passed }}"- FAILED="${{ steps.e2e.outputs.failed }}"- FAILURES="${{ steps.e2e.outputs.failures }}"-- if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then- echo "::notice title=E2E Curl Tests::✅ ${PASSED:-All} tests passed"- else- echo "::error title=E2E Curl Tests::❌ ${FAILED} failed, ${PASSED} passed"- echo "$FAILURES" | while read -r line; do- [ -n "$line" ] && echo "::warning::$line"- done- fi-- - name: Upload results- if: always()- uses: actions/upload-artifact@v4- with:- name: e2e-results- path: tests/e2e/results/- retention-days: 7-- - name: Show logs on failure- if: failure()- run: |- docker compose -f tests/e2e/docker-compose.yml logs pinchtabdiff --git a/.github/workflows/e2e-recent.yml b/.github/workflows/e2e-recent.ymlnew file mode 100644index 00000000..0c882126--- /dev/null+++ b/.github/workflows/e2e-recent.yml@@ -0,0 +1,266 @@+name: E2E Recent Tests++permissions:+ contents: read++on:+ push:+ branches: [main]+ paths-ignore:+ - '**.md'+ - 'docs/**'+ - 'LICENSE'+ - '.gitignore'+ - 'skill/**'+ - 'plugin/**'+ pull_request:+ branches: [main]+ paths-ignore:+ - '**.md'+ - 'docs/**'+ - 'LICENSE'+ - '.gitignore'+ - 'skill/**'+ - 'plugin/**'+ workflow_dispatch:++env:+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true++jobs:+ recent:+ name: E2E Recent Tests+ runs-on: ubuntu-latest+ if: github.event_name != 'pull_request' || github.event.pull_request.draft == false+ timeout-minutes: 10++ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Go+ uses: actions/setup-go@v5+ with:+ go-version-file: go.mod+ cache: true++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Run recent E2E tests+ id: e2e+ run: |+ set +e+ mkdir -p tests/e2e/results++ ./dev e2e recent 2>&1 | tee e2e-output.log+ EXIT_CODE=${PIPESTATUS[0]}++ PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)++ echo "passed=$PASSED" >> $GITHUB_OUTPUT+ echo "failed=$FAILED" >> $GITHUB_OUTPUT++ {+ echo 'failures<<EOF'+ echo "$FAILURES"+ echo 'EOF'+ } >> $GITHUB_OUTPUT++ exit $EXIT_CODE+ env:+ DOCKER_BUILDKIT: 1+ COMPOSE_DOCKER_CLI_BUILD: 1++ - name: Dump pinchtab logs on failure+ if: failure()+ run: |+ echo "==== pinchtab logs ===="+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab || true+ echo ""+ echo "==== filtered Chrome/extension lines ===="+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab 2>/dev/null | grep -Ei 'chrome|extension|devtools|load-extension|disable-extensions|headless|warning|error' || true+ echo ""+ echo "==== instance inventory ===="+ INSTANCES_JSON=$(curl -sf http://localhost:9999/instances || true)+ if [ -n "$INSTANCES_JSON" ]; then+ echo "$INSTANCES_JSON"+ if command -v jq >/dev/null 2>&1; then+ echo "$INSTANCES_JSON" | jq -r '.[].id' | while read -r inst_id; do+ [ -z "$inst_id" ] && continue+ echo ""+ echo "==== logs for $inst_id ===="+ curl -sf "http://localhost:9999/instances/$inst_id/logs" || true+ done+ fi+ else+ echo "unable to fetch /instances from localhost:9999"+ fi++ - name: Post summary+ if: always()+ run: |+ if [ "${{ steps.e2e.outputs.failed }}" = "0" ]; then+ echo "## ✅ E2E Recent Tests Passed" >> $GITHUB_STEP_SUMMARY+ echo "**${{ steps.e2e.outputs.passed }}** tests passed" >> $GITHUB_STEP_SUMMARY+ else+ echo "## ❌ E2E Recent Tests Failed" >> $GITHUB_STEP_SUMMARY+ echo "**Passed:** ${{ steps.e2e.outputs.passed }}" >> $GITHUB_STEP_SUMMARY+ echo "**Failed:** ${{ steps.e2e.outputs.failed }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ fi++ - name: Report check annotation+ if: always()+ run: |+ PASSED="${{ steps.e2e.outputs.passed }}"+ FAILED="${{ steps.e2e.outputs.failed }}"++ if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then+ echo "::notice title=E2E Recent Tests::✅ ${PASSED:-All} tests passed"+ else+ echo "::error title=E2E Recent Tests::❌ ${FAILED} failed, ${PASSED} passed"+ fi++ e2e-curl:+ name: E2E Curl Tests+ needs: recent+ runs-on: ubuntu-latest+ timeout-minutes: 15++ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Go+ uses: actions/setup-go@v5+ with:+ go-version-file: go.mod+ cache: true++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Run E2E curl tests+ id: e2e+ run: |+ set +e+ mkdir -p tests/e2e/results+ ./dev e2e curl 2>&1 | tee e2e-output.log+ EXIT_CODE=${PIPESTATUS[0]}++ PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)++ echo "passed=$PASSED" >> $GITHUB_OUTPUT+ echo "failed=$FAILED" >> $GITHUB_OUTPUT+ {+ echo 'failures<<EOF'+ echo "$FAILURES"+ echo 'EOF'+ } >> $GITHUB_OUTPUT++ exit $EXIT_CODE+ env:+ DOCKER_BUILDKIT: 1+ COMPOSE_DOCKER_CLI_BUILD: 1++ - name: Post summary+ if: always()+ run: |+ if [ "${{ steps.e2e.outputs.failed }}" = "0" ]; then+ echo "## ✅ E2E Curl Tests Passed" >> $GITHUB_STEP_SUMMARY+ echo "**${{ steps.e2e.outputs.passed }}** tests passed" >> $GITHUB_STEP_SUMMARY+ else+ echo "## ❌ E2E Curl Tests Failed" >> $GITHUB_STEP_SUMMARY+ echo "**Passed:** ${{ steps.e2e.outputs.passed }}" >> $GITHUB_STEP_SUMMARY+ echo "**Failed:** ${{ steps.e2e.outputs.failed }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ fi++ - name: Report check annotation+ if: always()+ run: |+ PASSED="${{ steps.e2e.outputs.passed }}"+ FAILED="${{ steps.e2e.outputs.failed }}"+ if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then+ echo "::notice title=E2E Curl Tests::✅ ${PASSED:-All} tests passed"+ else+ echo "::error title=E2E Curl Tests::❌ ${FAILED} failed, ${PASSED} passed"+ fi++ e2e-cli:+ name: E2E CLI Tests+ needs: recent+ runs-on: ubuntu-latest+ timeout-minutes: 15++ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Go+ uses: actions/setup-go@v5+ with:+ go-version-file: go.mod+ cache: true++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Run CLI E2E tests+ id: e2e+ run: |+ set +e+ ./dev e2e cli 2>&1 | tee e2e-output.log+ EXIT_CODE=${PIPESTATUS[0]}++ PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || echo "0")+ FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true)++ echo "passed=$PASSED" >> $GITHUB_OUTPUT+ echo "failed=$FAILED" >> $GITHUB_OUTPUT+ {+ echo 'failures<<EOF'+ echo "$FAILURES"+ echo 'EOF'+ } >> $GITHUB_OUTPUT++ exit $EXIT_CODE+ env:+ DOCKER_BUILDKIT: 1+ COMPOSE_DOCKER_CLI_BUILD: 1++ - name: Post summary+ if: always()+ run: |+ if [ "${{ steps.e2e.outputs.failed }}" = "0" ]; then+ echo "## ✅ E2E CLI Tests Passed" >> $GITHUB_STEP_SUMMARY+ echo "**${{ steps.e2e.outputs.passed }}** tests passed" >> $GITHUB_STEP_SUMMARY+ else+ echo "## ❌ E2E CLI Tests Failed" >> $GITHUB_STEP_SUMMARY+ echo "**Passed:** ${{ steps.e2e.outputs.passed }}" >> $GITHUB_STEP_SUMMARY+ echo "**Failed:** ${{ steps.e2e.outputs.failed }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY+ echo '```' >> $GITHUB_STEP_SUMMARY+ fi++ - name: Report check annotation+ if: always()+ run: |+ PASSED="${{ steps.e2e.outputs.passed }}"+ FAILED="${{ steps.e2e.outputs.failed }}"+ if [ "$FAILED" = "0" ] || [ -z "$FAILED" ]; then+ echo "::notice title=E2E CLI Tests::✅ ${PASSED:-All} tests passed"+ else+ echo "::error title=E2E CLI Tests::❌ ${FAILED} failed, ${PASSED} passed"+ fidiff --git a/dev b/devindex 662fdfaf..b9102da8 100755--- a/dev+++ b/dev@@ -23,6 +23,7 @@ COMMANDS=("check:🧪:All checks""test:🔬:Unit tests""e2e:🐳:E2E tests"+ " recent:🐳:E2E Recent tests"" curl:🐳:E2E Curl tests"" cli:🐳:E2E CLI tests""doctor:🩺:Setup dev environment"@@ -37,6 +38,13 @@ COMMANDS=(# ── Helpers ──────────────────────────────────────────────────────────+build_e2e_cli_binary() {+ echo " ${MUTED}Building static binary for E2E CLI tests...${NC}"+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o tests/e2e/runner-cli/pinchtab ./cmd/pinchtab+ echo " ${SUCCESS}✓${NC} Binary built"+ echo ""+}+show_help() {echo ""echo " ${ACCENT}${BOLD}🦀 Pinchtab Dev${NC}"@@ -114,43 +122,111 @@ run_command() {echo ""exec bash scripts/test.sh system;;- "e2e")- echo " ${ACCENT}${BOLD}🐳 E2E Curl tests (Docker)${NC}"- echo ""- docker compose -f tests/e2e/docker-compose.yml up --build --abort-on-container-exit- local curl_exit=$?- docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null- echo ""- echo " ${ACCENT}${BOLD}🐳 E2E CLI tests (Docker)${NC}"- echo ""- echo " ${MUTED}Building static binary...${NC}"- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o tests/e2e/runner-cli/pinchtab ./cmd/pinchtab- echo " ${SUCCESS}✓${NC} Binary built"- echo ""- docker compose -f tests/e2e/docker-compose-cli.yml up --build --abort-on-container-exit- local cli_exit=$?- docker compose -f tests/e2e/docker-compose-cli.yml down -v 2>/dev/null- echo ""- if [ $curl_exit -ne 0 ] || [ $cli_exit -ne 0 ]; then- echo " ${ERROR}Some E2E tests failed${NC}"- exit 1- fi- echo " ${SUCCESS}All E2E tests passed${NC}"- exit 0- ;;- "e2e curl")- echo " ${ACCENT}${BOLD}🐳 E2E Curl tests (Docker)${NC}"- echo ""- exec docker compose -f tests/e2e/docker-compose.yml up --build --abort-on-container-exit- ;;- "e2e cli")- echo " ${ACCENT}${BOLD}🐳 E2E CLI tests (Docker)${NC}"- echo ""- echo " ${MUTED}Building static binary...${NC}"- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o tests/e2e/runner-cli/pinchtab ./cmd/pinchtab- echo " ${SUCCESS}✓${NC} Binary built"- echo ""- exec docker compose -f tests/e2e/docker-compose-cli.yml up --build --abort-on-container-exit+ "e2e"*)+ # Ensure extension fixtures are readable and traversable by the docker user (UID 1000)+ # Directories need +x to be searchable.+ chmod -R 755 tests/e2e/fixtures/test-extension* 2>/dev/null || true++ case "$target" in+ "e2e")+ echo " ${ACCENT}${BOLD}🐳 E2E Recent tests (Docker)${NC}"+ echo ""+ docker compose -f tests/e2e/docker-compose.yml run --build --rm runner /scenarios/run-recent.sh+ local recent_exit=$?+ if [ $recent_exit -ne 0 ]; then+ echo -e "${ERROR} Recent tests failed. Showing pinchtab logs:${NC}"+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab | tail -n 50+ docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null+ exit 1+ fi+ docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null++ echo ""+ echo " ${ACCENT}${BOLD}🐳 E2E Full Curl tests (Docker)${NC}"+ echo ""+ docker compose -f tests/e2e/docker-compose.yml up --abort-on-container-exit+ local curl_exit=$?+ if [ $curl_exit -ne 0 ]; then+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab | tail -n 50+ fi+ docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null++ echo ""+ echo " ${ACCENT}${BOLD}🐳 E2E CLI tests (Docker)${NC}"+ echo ""+ build_e2e_cli_binary+ docker compose -f tests/e2e/docker-compose-cli.yml up --build --abort-on-container-exit+ local cli_exit=$?+ if [ $cli_exit -ne 0 ]; then+ docker compose -f tests/e2e/docker-compose-cli.yml logs pinchtab | tail -n 50+ fi+ docker compose -f tests/e2e/docker-compose-cli.yml down -v 2>/dev/null++ echo ""+ if [ $curl_exit -ne 0 ] || [ $cli_exit -ne 0 ]; then+ echo " ${ERROR}Some E2E tests failed${NC}"+ exit 1+ fi+ echo " ${SUCCESS}All E2E tests passed${NC}"+ exit 0+ ;;+ "e2e curl")+ echo " ${ACCENT}${BOLD}🐳 E2E Curl tests (Docker)${NC}"+ echo ""+ docker compose -f tests/e2e/docker-compose.yml up --build --abort-on-container-exit+ local curl_exit=$?+ if [ $curl_exit -ne 0 ]; then+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab | tail -n 50+ fi+ docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null+ exit $curl_exit+ ;;+ "e2e cli")+ echo " ${ACCENT}${BOLD}🐳 E2E CLI tests (Docker)${NC}"+ echo ""+ build_e2e_cli_binary+ docker compose -f tests/e2e/docker-compose-cli.yml up --build --abort-on-container-exit+ local cli_exit=$?+ if [ $cli_exit -ne 0 ]; then+ docker compose -f tests/e2e/docker-compose-cli.yml logs pinchtab | tail -n 50+ fi+ docker compose -f tests/e2e/docker-compose-cli.yml down -v 2>/dev/null+ exit $cli_exit+ ;;+ "e2e recent")+ echo " ${ACCENT}${BOLD}🐳 E2E Recent tests (Docker)${NC}"+ echo ""+ docker compose -f tests/e2e/docker-compose.yml run --build --rm runner /scenarios/run-recent.sh+ local recent_exit=$?+ if [ $recent_exit -ne 0 ]; then+ echo ""+ echo -e "${ERROR} Recent tests failed. Dumping pinchtab logs:${NC}"+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab || true+ echo ""+ echo -e "${ERROR} Filtered Chrome/extension lines:${NC}"+ docker compose -f tests/e2e/docker-compose.yml logs pinchtab 2>/dev/null | grep -Ei 'chrome|extension|devtools|load-extension|disable-extensions|headless|warning|error' || true+ echo ""+ echo -e "${ERROR} Instance inventory:${NC}"+ local instances_json+ instances_json=$(curl -sf http://localhost:9999/instances || true)+ if [ -n "$instances_json" ]; then+ echo "$instances_json"+ if command -v jq >/dev/null 2>&1; then+ while IFS= read -r inst_id; do+ [ -z "$inst_id" ] && continue+ echo ""+ echo -e "${ERROR} Instance logs for ${inst_id}:${NC}"+ curl -sf "http://localhost:9999/instances/${inst_id}/logs" || true+ done < <(echo "$instances_json" | jq -r '.[].id')+ fi+ else+ echo " unable to fetch /instances from localhost:9999"+ fi+ fi+ docker compose -f tests/e2e/docker-compose.yml down -v 2>/dev/null+ exit $recent_exit+ ;;+ esac;;"dev") exec bash scripts/dev.sh ;;"build") exec bash scripts/build.sh ;;diff --git a/tests/e2e/README.md b/tests/e2e/README.mdindex 14a1e505..44d144a6 100644--- a/tests/e2e/README.md+++ b/tests/e2e/README.md@@ -7,7 +7,10 @@ End-to-end tests for PinchTab that exercise the full stack including browser aut### With Docker (recommended)```bash-./dev e2e+./dev e2e # Run all E2E tests+./dev e2e recent # Run only recently added/changed scenarios (fast feedback)+./dev e2e curl # Run only Curl-based scenarios+./dev e2e cli # Run only CLI-based scenarios```Or directly:diff --git a/tests/e2e/scenarios/run-all.sh b/tests/e2e/scenarios/run-all.shindex a0b42e3e..2059b282 100755--- a/tests/e2e/scenarios/run-all.sh+++ b/tests/e2e/scenarios/run-all.sh@@ -14,6 +14,7 @@ echo "FIXTURES_URL: ${FIXTURES_URL}"echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"echo ""+echo "Waiting for instances to become ready..."wait_for_instance_ready "${PINCHTAB_URL}"wait_for_instance_ready "${PINCHTAB_SECURE_URL}"echo ""diff --git a/tests/e2e/scenarios/run-recent.sh b/tests/e2e/scenarios/run-recent.shnew file mode 100755index 00000000..ee7a7ede--- /dev/null+++ b/tests/e2e/scenarios/run-recent.sh@@ -0,0 +1,47 @@+#!/bin/bash+# run-recent.sh - Run only recently added/changed E2E test scenarios+# This runs a fast subset for fail-fast CI before the full suites.++set -uo pipefail++SCRIPT_DIR="$(dirname "$0")"+source "${SCRIPT_DIR}/common.sh"++echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"+echo -e "${BLUE}PinchTab E2E Recent Tests${NC}"+echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"+echo "PINCHTAB_URL: ${PINCHTAB_URL}"+echo "FIXTURES_URL: ${FIXTURES_URL}"+echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"+echo ""++echo "Waiting for instances to become ready..."+wait_for_instance_ready "${PINCHTAB_URL}"+wait_for_instance_ready "${PINCHTAB_SECURE_URL}"+echo ""++# Recent test files — add new scenarios here for fast CI feedback.+# Move to the full suite (run-all.sh) once stable.+RECENT_TESTS=(+ "41-extensions.sh"+)++for name in "${RECENT_TESTS[@]}"; do+ script="${SCRIPT_DIR}/${name}"+ if [ -f "$script" ]; then+ echo -e "${YELLOW}Running: ${name}${NC}"+ echo ""+ source "$script"+ echo ""+ else+ echo -e "${RED}Missing: ${name}${NC}"+ fi+done++print_summary++if [ -d "${RESULTS_DIR:-}" ]; then+ echo "passed=$TESTS_PASSED" > "${RESULTS_DIR}/summary.txt"+ echo "failed=$TESTS_FAILED" >> "${RESULTS_DIR}/summary.txt"+ echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "${RESULTS_DIR}/summary.txt"+fi