test-all

작성자: facebook

병렬 테스트 오케스트레이터. Task 하위 에이전트와 iwsdk CLI를 통해 9개의 모든 테스트 스위트를 동시에 실행합니다. 빌드, 예제 설정, 개발 서버, 에이전트 실행 등을 처리합니다.

npx skills add https://github.com/facebook/immersive-web-sdk --skill test-all

Test All — Parallel Orchestrator

Runs all 9 IWSDK test suites simultaneously. The orchestrator handles the full lifecycle: build, example prep, dev servers, sub-agent launch, polling, retries, cleanup, and aggregate reporting.

Each test gets its own example directory and dev server. Sub-agents read the skill files and execute tests through the direct npx @iwsdk/cli flow described in each skill.


Test Map

AgentExample DirSuitesSkill File
test-interactionsexamples/poke12test-interactions/SKILL.md
test-ecs-coreexamples/poke-ecs8test-ecs-core/SKILL.md
test-environmentexamples/poke-environment6test-environment/SKILL.md
test-levelexamples/poke-level5test-level/SKILL.md
test-uiexamples/poke-ui5test-ui/SKILL.md
test-audioexamples/audio6test-audio/SKILL.md
test-grabexamples/grab5test-grab/SKILL.md
test-locomotionexamples/locomotion6test-locomotion/SKILL.md
test-physicsexamples/physics5test-physics/SKILL.md

Ports are not pre-assigned. Each dev server picks its own port dynamically. The orchestrator can discover each active URL from the server logs or npx @iwsdk/cli dev status, but the sub-agent skills no longer need the port explicitly.


Phase 1: Prerequisites & Build

node -v
pnpm -v

Verify node >= 20.19.0 and pnpm is available. Stop on failure.

pnpm install
cd packages/vite-plugin-dev && npx playwright install chromium && cd ../..
pnpm build:tgz

All must succeed. Stop on failure. Note: npx playwright must run from packages/vite-plugin-dev where playwright is a dependency.


Phase 2: Prepare Examples

Clone poke for tests that share it

5 tests use the poke example. Clone it into separate directories so each gets its own dev server:

node scripts/test-prep.mjs clone

Fresh install all 9 examples in parallel

node scripts/test-prep.mjs install

Phase 3: Start 9 Dev Servers

Start all dev servers, wait for them to be ready, and discover their active URLs. This single command handles everything — starting servers, polling for readiness, and outputting the current port map:

node scripts/test-servers.mjs start

The output is JSON with the current port map: {"poke": 8084, "poke-ecs": 8082, ...}. Keep it for diagnostics, but the sub-agents should rely on the direct CLI flow inside each example directory rather than passing ports around.

If any server fails to start within 60 seconds, the script reports which ones are missing and exits with code 1. Check /tmp/iwsdk-dev-<name>.log for errors.

To re-check ports later without restarting:

node scripts/test-servers.mjs ports

Phase 4: Launch 9 Sub-Agents

For each test, launch a Task sub-agent with subagent_type: "Bash", mode: "bypassPermissions", and run_in_background: true.

Sub-agent prompt template

Each sub-agent gets this prompt (with <SKILL_FILE>, <EXAMPLE_DIR>, and <ROOT> substituted):

Read the file at <ROOT>/.claude/skills/<SKILL_FILE> and execute the test instructions
starting from Step 3 (Verify Connectivity). Steps 1 and 2 have already been completed —
the dev server for <EXAMPLE_DIR> is already running.

Execute all test suites (Steps 3-4), then do Step 5 (cleanup and results summary).
Do NOT kill the dev server in cleanup — the parent agent will handle that.

Launch all 9 agents

Launch all 9 Task agents in a single message with multiple Task tool calls. This starts them concurrently.

Save each agent's task_id and output_file from the tool result. Track them:

agents = {
  "test-interactions": { task_id: "...", output_file: "...", example_dir: "examples/poke", status: "running" },
  "test-ecs-core":     { task_id: "...", output_file: "...", example_dir: "examples/poke-ecs", status: "running" },
  ...
}

Phase 5: Wait for Agents to Complete

After launching all 9 agents, simply wait. The system automatically delivers a completion notification when each agent finishes. Do NOT poll, do NOT run bash commands to check output files. Just wait for the notifications.

As each agent completes, note its result (PASS/FAIL and suite counts) from the notification. When all 9 have reported, proceed to Phase 7.

Hard timeout: 20 minutes total from Phase 4 start. If any agent hasn't completed by then, use Read on its output_file to check what happened, then mark it as TIMEOUT and proceed to Phase 7.


Phase 6: Retry Failed Agents

If any agent fails due to a transient error (not a test assertion failure):

  1. Use Task(resume: <task_id>) to continue the agent with its full context
  2. Wait for its completion notification
  3. If it fails again, mark it FAIL and move on

Retry limits

  • Max 1 retry per agent
  • Only retry transient failures (connection refused, timeout) — not test assertion failures

IMPORTANT: Do NOT use improvised bash commands (kill, lsof, etc.) for retries. Use node scripts/test-servers.mjs stop and node scripts/test-servers.mjs start if a server needs restarting. All bash commands in this skill must be one of the pre-approved node scripts/... commands or the Phase 1 build commands.


Phase 7: Results & Cleanup

Kill all dev servers

node scripts/test-servers.mjs stop

Delete poke clones

node scripts/test-prep.mjs cleanup

Aggregate Results

Collect each agent's summary table from its output file. Print a grand summary:

========================================
  IWSDK Test Suite — Full Results
========================================

| Test              | Suites | Result  |
|-------------------|--------|---------|
| test-interactions | 12/12  | PASS    |
| test-ecs-core     |  8/8   | PASS    |
| test-environment  |  6/6   | PASS    |
| test-level        |  5/5   | PASS    |
| test-ui           |  5/6   | PASS    |
| test-audio        |  6/6   | PASS    |
| test-grab         |  5/5   | PASS    |
| test-locomotion   |  6/6   | PASS    |
| test-physics      |  5/5   | PASS    |
|-------------------|--------|---------|
| TOTAL             | 58/59  | 9/9 PASS|

========================================

If any test failed, include the failure details from that agent's output.


Key Design Decisions

Orchestrator manages dev servers, sub-agents run tests

Sub-agents (Task tool) cannot run background processes. The orchestrator starts all 9 dev servers, records their dynamically-assigned ports for diagnostics, then launches sub-agents that only execute the test steps. Each sub-agent reads its skill file and starts from Step 3 (Verify Connectivity).

Runtime-first server discovery for diagnostics

Ports are NOT pre-assigned. Each dev server is started with npm run dev and Vite picks an available port automatically. The orchestrator may still collect the resulting port map for diagnostics, but that data is only for the parent agent's visibility. Sub-agents should treat the running example directory as the source of truth and use the direct npx @iwsdk/cli flow from inside that directory.

Sub-agents read skill files directly

Each sub-agent reads its SKILL.md at runtime. No extraction or text munging needed — the sub-agent is told to skip Steps 1-2 (already done) and start from Step 3. Do NOT pass ports in the prompt.

TaskOutput vs file-based polling

Background Task agents write output to a file. Use Read tool on the output_file to check progress. This is more reliable than parsing process stdout.

Boolean values must be JSON booleans

When setting boolean fields via ecs_set_component, the value must be a JSON boolean (true), not a string ("true"). Strings silently fail to coerce.


Troubleshooting

Agent finishes but no summary table

The sub-agent may have hit its turn limit. Check the end of its output for truncation. Relaunch with the same prompt.

Port already in use

Run node scripts/test-servers.mjs stop to clear the managed dev servers before relaunching.

fresh:install fails

Check that pnpm build:tgz succeeded and the tarballs exist in the package directories.

All agents stuck at "Verify Connectivity"

The dev servers may not have started. Check /tmp/iwsdk-dev-*.log for errors.

Clone directory already exists

The rsync command will overwrite existing files. If you need a clean slate, delete the clone directories first.

Sub-agent can't start dev server

This is expected — sub-agents cannot run background processes. The orchestrator must start all dev servers before launching sub-agents.

facebook의 다른 스킬

gc-safe-coding
facebook
전체 설명과 근거는 doc/GCSafeCoding.md를 참조하십시오.
app-review-prep
facebook
Meta 앱을 App Review용으로 준비합니다 — 현재 상태, 미해결 요구 사항, 부여된 권한, 제출 내역을 확인합니다. 앱을 제출하기 전에 사용하세요…
api-health
facebook
Meta 앱의 API 상태를 모니터링합니다 — 비율 제한, 호출량, API 지원 중단 여부를 확인합니다. 트래픽 제한을 진단하거나, 용량을 계획하거나, API 버전 변경에 대비하는 데 사용합니다…
debug-webhooks
facebook
Meta 앱의 웹훅 문제를 해결합니다 — 활성 구독을 검사하고, 잘못된 구성을 식별하며, 테스트 페이로드를 전송하여 전달을 확인합니다. 다음과 같은 경우에 사용하세요…
api-integration
facebook
개발자가 Meta API 통합을 처음부터 설정하도록 안내합니다 — 적절한 API를 찾아내고, 설정 가이드, 인증 요구 사항 등을 가져옵니다…
webhook-setup
facebook
Meta 앱용 웹훅을 처음부터 끝까지 설정하세요 — 사용 가능한 주제를 탐색하고, 필드를 구독하고, 테스트 페이로드로 검증합니다. 웹훅을 구성할 때 사용하세요…
test-ui
facebook
iwsdk CLI를 사용하여 포크 예제에 대해 Test UI 시스템(PanelUI, ScreenSpace)을 테스트합니다.
flags
facebook
React 릴리스 채널 간 기능 플래그 상태를 검사하고 비교합니다. 모든 채널(www, www-modern, canary, next, experimental, rn 변형)의 플래그를 보거나 --diff로 특정 채널을 비교합니다. 출력 형식은 기본 테이블 보기, CSV 내보내기, 정리 상태 그룹화를 포함합니다. 플래그 상태는 기호로 표시됩니다: 활성화(✅), 비활성화(❌), 변형 테스트(🧪), 프로파일링 전용(📊). 일반적인 실수: __VARIANT__ 플래그는 www에서 두 상태 모두 테스트되며, --diff를 사용하여 의미 있는 차이를 찾습니다...