test-runner-worktree

Run Rust cargo tests in git worktrees with sourced environment variables.

3|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/codekiln/langstar --skill test-runner-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-runner-worktree
Source: https://github.com/codekiln/langstar/tree/main/.claude/skills/test-runner-worktree
Command: npx skills add https://github.com/codekiln/langstar --skill test-runner-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common test failures and debugging headaches in git worktree environments. It ensures correct environment variable sourcing, working directory context, and SDK version usage, saving you time and frustration.

Core Features & Use Cases

  • Context-Aware Testing: Guides users to run tests from the correct git worktree or main repository, preventing SDK version mismatches that lead to misleading test results.
  • Secure Environment Handling: Safely checks and sources environment variables (like API keys) from your devcontainer without exposing sensitive data.
  • Use Case: When developing a new feature in a git worktree, use this skill to ensure your integration tests run against your feature branch's SDK, not the potentially outdated main branch SDK.

Quick Start

Guide me on how to run integration tests for the integration_deployment_workflow test file in my current git worktree.

Frequently Asked Questions about test-runner-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run cargo tests in a git worktree without environment variable errors?

Run cargo tests in git worktrees by sourcing `/workspace/.devcontainer/.env` before executing any cargo commands. This ensures environment variables like API keys are correctly loaded and prevents authentication failures or SDK version mismatches that cause misleading test results.

Why do my Rust tests pass locally but fail in a git worktree?

Test failures in worktrees typically stem from missing environment variable sourcing or incorrect working directory context. Worktrees may reference an outdated SDK version from the main branch. Source the devcontainer environment file and run tests from the correct worktree directory to match your feature branch's SDK.

Can I run the full pre-commit sequence (cargo fmt, cargo check, cargo clippy, cargo test) across worktrees?

Yes. Execute the complete pre-commit sequence in worktrees by sourcing `/workspace/.devcontainer/.env` first, then running each cargo command in sequence while preserving the correct working directory per worktree. This maintains consistent environment state across all checks.

What causes test results to differ between runs in a git worktree environment?

Inconsistent test results in worktrees occur when environment variables are not sourced or working directory context shifts between runs. Ensure `/workspace/.devcontainer/.env` is sourced before each test invocation and maintain the same worktree directory throughout your testing session.

How do I debug integration tests when authentication fails in a worktree?

Authentication errors in worktrees indicate missing or incorrectly sourced environment variables. Verify that `/workspace/.devcontainer/.env` is sourced before running integration tests, and confirm the working directory matches your target worktree to use the correct credentials and SDK.

Do I need to configure anything special to run cargo test in multiple git worktrees?

Each worktree requires sourcing `/workspace/.devcontainer/.env` and maintaining its own working directory context before running cargo test. This prevents SDK version confusion and ensures each worktree's tests run against its correct feature branch dependencies, not the main branch SDK.