Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: TC explore and generate test cases
name: tc-workflow

# Runs after "Build release APK" completes successfully, or manually (workflow_dispatch).
# Reads the tc-handoff artifact (bs:// app id + feature context), explores the app on a real
Expand All @@ -14,9 +14,9 @@ on:
required: false
default: "BStackBankLatest"
device:
description: "Device name (leave empty to let Test Companion choose)"
description: "Device name (default Google Pixel 9; OS version is chosen by Test Companion)"
required: false
default: ""
default: "Google Pixel 9"
os_version:
description: "OS version (only used together with a device)"
required: false
Expand All @@ -27,7 +27,7 @@ on:
default: ""

concurrency:
group: tc-explore
group: tc-workflow
cancel-in-progress: false

permissions:
Expand All @@ -41,7 +41,8 @@ env:
TM_PROJECT: "PR-172074" # Test-Companion-Demo-Vision
TM_FOLDER_NAME: "Functional"
TM_FOLDER_ID: "60058724"
DEVICE: ${{ github.event.inputs.device }}
# workflow_run (auto) has no inputs, so fall back to Google Pixel 9. OS version stays empty.
DEVICE: ${{ github.event.inputs.device || 'Google Pixel 9' }}
OS_VERSION: ${{ github.event.inputs.os_version }}

jobs:
Expand Down Expand Up @@ -137,7 +138,7 @@ jobs:
--auto-grant-permissions --save-to-tm --yolo --json "$INSTRUCTIONS" 2>&1 | tee "tc-run-$attempt.log"
code=${PIPESTATUS[0]}
if grep -qE 'Session liveness check failed|session crashed/terminated|No active Appium session|task_blocked|could not be started|no longer available on BrowserStack|not one of the devices provided' "tc-run-$attempt.log"; then
echo "Device session failed on attempt $attempt (exit $code). Discarding anything created without a device."
echo "Device session failed on attempt $attempt (exit $code): the session died at start. Likely causes: device unavailable, app crashing on launch, or no free parallels. Check the session in the App Automate dashboard."
tc tm review --reject --all || true
continue
fi
Expand Down Expand Up @@ -167,7 +168,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: always()
with:
name: tc-explore-logs
name: tc-workflow-logs
path: |
tc-run-*.log
tc-summary.md
Expand Down
61 changes: 0 additions & 61 deletions scripts/run-tc-explore.sh

This file was deleted.

18 changes: 18 additions & 0 deletions scripts/run-tc-workflow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Trigger the Test Companion exploration directly, without the app build/merge flow.
#
# Usage:
# ./scripts/run-tc-workflow.sh ci [app] [device] [os_version] # runs the GitHub workflow (workflow_dispatch)
# ./scripts/run-tc-workflow.sh local [app] [device] [os_version] # runs tc on THIS machine
#
# app bs://<hash>, or a custom id such as BStackBankLatest (default). Custom ids are
# resolved to the real bs://<hash> first; tc rejects a bare custom id.
# device optional, e.g. "Google Pixel 8". Empty = Test Companion chooses.
# os_version optional, only used together with a device
#
# Both modes use .github/tc-context/feature-context.md as the exploration prompt.
set -euo pipefail

MODE="${1:-ci}"
APP="${2:-BStackBankLatest}"
DEVICE="${3:-Google Pixel 9}"
Loading