Modifying Test Components
Testing & Qualitymodifying-test-componentsModifying Test Components is an Agent Skill for testing & quality published in the golemcloud/golem repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Building or modifying test WASM components in test-components/. Use when a test component needs to be rebuilt, a new test component is needed, or SDK changes require downstream test component rebuilds.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/golemcloud/golem/blob/HEAD/.agents/skills/modifying-test-components/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/modifying-test-components, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Modifying Test Components
Worker executor tests, integration tests, and CLI integration tests use built WASM artifacts from test-components/. These .wasm files are no longer checked into the repository; compiling the components needed by the selected tests is a separate step before running those tests.
Key Rules
- Do not rebuild more test components than necessary. Prefer rebuilding only the components required by the selected tests.
- Only rebuild if the test component has its own
AGENTS.mdwith build instructions. If it doesn't, the component cannot be rebuilt by you. - SDK changes require rebuilding dependent test components. If you modify
sdks/rust/orsdks/ts/, you must rebuild any test components that use the changed SDK.
When to Rebuild
| Change | Action Required |
|---|---|
| Modifying a test component's source code | Rebuild that component (if it has an AGENTS.md) |
Modifying sdks/rust/ (golem-rust) | Rebuild Rust test components that depend on it |
Modifying sdks/ts/ (golem-ts-sdk) | Rebuild agent template WASM first, then TS test components |
| Modifying WIT interfaces | Run cargo make wit, then rebuild affected components |
| Running worker executor / integration / CLI integration tests that depend on missing test-component WASMs | Rebuild the specific components those tests use before running the tests |
| No source changes and required WASMs already exist | Do not rebuild |
Rebuilding a Test Component
Step 1: Check for build instructions
cat test-components/<component-name>/AGENTS.md
If no AGENTS.md exists, stop — you cannot rebuild this component.
Step 2: Follow the component's AGENTS.md
Each component's AGENTS.md contains specific build instructions. Follow them exactly.
Important: When running golem build (or ../../target/debug/golem build) for test components, always pass --yes to automatically confirm dependency/configuration updates without interactive prompts. For example:
../../target/debug/golem build --yes
TS SDK Change Rebuild Chain
When modifying the TypeScript SDK, you must follow this exact rebuild order:
1. Build the TS SDK packages
cd sdks/ts
npx pnpm install
npx pnpm run build
2. Rebuild the agent template WASM
This step is required before rebuilding any TS test components. The agent template embeds the SDK runtime.
cd sdks/ts
npx pnpm run build-agent-template
Requires cargo-component v0.21.1 — see sdks/ts/AGENTS.md for installation.
3. Rebuild affected TS test components
Follow each component's AGENTS.md for specific instructions.
Rust SDK Change Rebuild Chain
When modifying the Rust SDK:
1. Build the Rust SDK
cargo build -p golem-rust
cargo build -p golem-rust-macro
2. Rebuild affected Rust test components
Follow each component's AGENTS.md for specific instructions. Rust test components typically use cargo component build with a local path dependency on golem-rust.
Finding Test Components
Test components live in test-components/. To find which ones have build instructions:
ls test-components/*/AGENTS.md
To find which test components depend on a specific SDK, check their Cargo.toml (Rust) or package.json (TS) for SDK references.
Checklist
- Confirmed the component has an
AGENTS.mdwith build instructions - If SDK was changed: rebuilt SDK first
- If TS SDK was changed: rebuilt agent template WASM before components
- Followed the component's specific
AGENTS.mdbuild instructions - Confirmed the expected
.wasmartifact now exists undertest-components/ - Ran the relevant tests after the rebuild (
cargo make worker-executor-tests,cargo make integration-tests, orcargo make cli-integration-tests)