name: testing-joyride description: 'Test Joyride features in the examples workspace. Covers output terminal verification, who-tracking, REPL log queries, and evaluation result validation. Use when: testing Joyride features.'
Testing Joyride
Structured testing patterns for verifying Joyride features in the examples workspace. This skill is a living document — test areas are added as features are developed and verified.
Principles
Consistent who slugs
Each test area uses a dedicated who slug. When querying the REPL log, filter by the slug you used — entries from other slugs (other agents, the human ui, previous test runs) will not appear in filtered results. This is by design, but means a query for the wrong slug returns nothing even when entries exist.
Verify via the log, not just the tool response
The joyride_evaluate_code tool returns result, stdout, stderr directly. But the REPL Output Log (clojure_repl_output_log) is the authoritative record of what happened — it captures categorized entries (evaluatedCode, evaluationResults, evaluationOutput, evaluationErrorOutput) with who attribution and timestamps. Always cross-check against the log when verifying features.
Use awaitResult deliberately
awaitResult: truefor expressions where you need the unwrapped resultawaitResult: falsefor expressions that throw or produce side effects you want to observe without hanging
Test Areas
Output Terminal and Who-Tracking
Verifies that evaluations appear in the Joyride Output terminal with correct who badges, and that the REPL log captures all output categories with consistent attribution.
Basic evaluation and logging
- Evaluate a simple expression with a dedicated
whoslug - Query the log filtered by that slug
- Confirm
evaluatedCodeandevaluationResultsentries exist with correctwho,ns, andrepl-session-key: "joyride"
Stdout capture
- Evaluate
(do (println "test-stdout") 42)withawaitResult: true - Confirm
stdoutfield in tool response contains"test-stdout\n" - Query log — confirm
evaluationOutputentry with the stdout text and correctwho
Stderr capture
- Evaluate with
awaitResult: false:(do (println "stdout-line") (binding [*print-fn* *print-err-fn*] (println "stderr-line")) (throw (ex-info "thrown-error" {:test true}))) - Confirm tool response has
stdout: "stdout-line\n"andstderr: "stderr-line\n" - Query log — confirm entries for all three:
evaluationOutput(stdout),evaluationErrorOutput(stderr),evaluationErrorOutput(thrown error), all with samewho
Who-tracking across evaluators
- Evaluate as slug A
- Evaluate as slug B
- Evaluate as slug A again
- Confirm third response includes
otherWhosSinceLast: ["B"] - Evaluate as slug A once more — confirm no
otherWhosSinceLast(no intervening evaluator)
Human UI evaluation tracking
- Evaluate as your slug
- Ask the human to evaluate something manually
- Evaluate as your slug again
- Confirm
otherWhosSinceLast: ["ui"]
Who consistency (comprehensive)
Use a single dedicated slug for an expression that produces stdout, stderr, and a thrown error simultaneously. Query the log and confirm every entry carries the same who value. This catches attribution bugs where output streams lose their evaluator identity.
Without Calva Connected
All tests above should also pass when Calva is not connected to the REPL. The Joyride REPL and Backseat Driver log operate independently of Calva's nREPL connection.