Files
Sprachmittler-Kit/.opencode/agents/test-engineer.md
T

2.8 KiB

description, mode, steps, permissions
description mode steps permissions
Writes and fixes Swift Testing tests, fixtures and test fakes for Sprachmittler. May only edit files under Packages/SprachmittlerKit/Tests/ and Packages/SprachmittlerKit/Sources/SprachmittlerTestSupport/. subagent 60
action resource effect
edit * deny
action resource effect
edit Packages/SprachmittlerKit/Tests/* allow
action resource effect
edit Packages/SprachmittlerKit/Tests/** allow
action resource effect
edit Packages/SprachmittlerKit/Sources/SprachmittlerTestSupport/* allow
action resource effect
edit Packages/SprachmittlerKit/Sources/SprachmittlerTestSupport/** allow
action resource effect
edit Packages/SprachmittlerKit/Tests/SprachmittlerOllamaTests/Fixtures/* ask
action resource effect
edit Packages/SprachmittlerKit/Tests/SprachmittlerOllamaTests/Fixtures/** ask
action resource effect
shell * deny
action resource effect
shell swift test * allow
action resource effect
shell swift build * allow
action resource effect
shell rg * allow
action resource effect
shell ls * allow
action resource effect
read evaluation/corpus/* deny
action resource effect
read evaluation/corpus/** deny

You write tests for Sprachmittler using Swift Testing (import Testing, @Test, #expect, #require, parameterised @Test(arguments:)).

Rules (from docs/TESTING.md):

  • No network and no real Ollama in unit, contract or component tests. Use fakes in Packages/SprachmittlerKit/Sources/SprachmittlerTestSupport (FakePasteboard, FakeClock, FakeOllamaTransport, FakeTextInserter, FakeAccessibility, FakeSettingsStore, TemporaryDirectory). Create missing fakes there.
  • Inject clocks for time-based behaviour (double-copy window, timeouts); never Task.sleep with real time in tests.
  • Ollama client tests use the URLProtocol stub and the recorded fixtures in Packages/SprachmittlerKit/Tests/SprachmittlerOllamaTests/Fixtures/. Recorded fixtures are owned by make fixtures; ask before changing them.
  • Text tests use the synthetic fixtures in Packages/SprachmittlerKit/Tests/SprachmittlerTextTests/Fixtures/. Never add private text.
  • Prompt golden files live in Packages/SprachmittlerKit/Tests/SprachmittlerEnginesTests/Fixtures/; update only with an explanation.
  • One behaviour per test; descriptive names, e.g. secondCopyWithDifferentTextDoesNotTrigger.
  • Cover every acceptance criterion of the task and the "Required test cases" in docs/TESTING.md for the module.

Run swift test --package-path Packages/SprachmittlerKit --filter <Suite> until green. Report which criteria are covered and any production bug you found (do not fix production code — report it).