Golem scala integration tests

From golemcloud/golem · View interactive version

Golem scala integration tests is an AI agent skill from the GitHub repository golemcloud/golem. Runs and debugs the Scala SDK's self-hosted Golem integration suite. Use for generated test agents, REPL samples, HTTP routes, host provisioning, or GolemExamplesIntegrationSpec.

How to use this skill

Skill file

Golem Scala Integration Tests

The suite is sdks/scala/integration-tests/src/test/scala/golem/integration/GolemExamplesIntegrationSpec.scala; its application is sdks/scala/test-agents/.

Repository test-policy conflict

This existing sbt suite directly launches the golem executable. That is a

known source-level conflict with the repository rule that subprocess-based

tests belong in the CLI integration test suite. Do not add coverage that

extends this pattern: place new subprocess coverage in CLI integration tests,

and keep non-CLI Scala tests process-free. The commands below document how to

verify the existing suite until that coverage is migrated.

Prerequisites

For a complete local Scala publication from repository root, use cargo make build-sdk-scala. For the exact CI setup, follow validate-sdk-scala in Makefile.sdk-validation.toml and main-validation-scala in Makefile.main-validation.toml.

Run

Use non-client sbt so build.sbt can forward GOLEM_TS_PACKAGES_PATH into the forked test JVM:

cd sdks/scala
GOLEM_TS_PACKAGES_PATH="$PWD/../ts/packages" \
  sbt -batch "++3.8.2; integrationTests/test"

Focused ZIO tests use the suite's current test names/tags, for example:

GOLEM_TS_PACKAGES_PATH=<packages> \
  sbt -batch '++3.8.2; integrationTests/testOnly -- -t snapshot-counter'

If client mode is unavoidable, explicitly pass -Dgolem.tsPackagesPath=... in integrationTests / Test / javaOptions; ordinary environment changes are not reliably propagated by a running sbt client.

Lifecycle

GolemServer.layer currently:

  1. checks golem --version, the TS package path, and port 9881;
  2. locates test-agents/golem.yaml from supported repository/checkout layouts;
  3. safely removes stale test-agents/golem-temp content, including symlinks;
  4. starts golem -vvv server run --clean --disable-app-manifest-discovery and writes sdks/scala/target/scala-integration/golem-server.log;
  5. invokes local manifest-aware golem deploy with one retry;
  6. provisions retry policies and secret values used by fixtures;
  7. runs all tests sequentially and kills the server process tree on release.

Commands use --yes --local --app-manifest-path <test-agents/golem.yaml>. The suite forwards GOLEM_TS_PACKAGES_PATH and, for build/server commands, RUST_BACKTRACE=1.

Do not start a second server, pre-deploy manually, or kill unrelated system processes as routine setup.

Current application contract

test-agents/golem.yaml is a manifest v1.6 application named scala-examples, with component ID scala:examples. Its build command selects sbt project testAgents, writes .golem/scala.js, injects that module into .generated/agent_guest.wasm, and preinitializes the resulting component. REPL samples are TypeScript files under test-agents/samples/; HTTP tests exercise manifest deployments on port 9006.

Avoid copying a full sample or agent inventory into this skill. The spec's samples table and manifest-coverage test are authoritative, and some tests are intentionally ignored unless their external dependency is enabled.

Debugging

Maintaining existing coverage

Do not add new subprocess-based coverage to this suite. Put new generated-application, REPL, and

CLI lifecycle coverage in the CLI integration test suite. When a contract change requires an

existing Scala sample or assertion to change, keep test-agents/src/main/scala/,

test-agents/samples/, and test-agents/golem.yaml aligned with the affected existing test; the

manifest-coverage test detects unregistered sample scripts.

Whenever an existing test changes, run that focused test. Use the full existing suite only for

shared lifecycle, manifest, generated-runtime, or cross-sample changes.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.