agentic-jumpstart-testing

Provide testing strategies for the Jarvy CLI with assert_cmd and predicates.

Updated Jul 13, 2024
One-click install
npx skills add https://github.com/bearbinary/Jarvy --skill agentic-jumpstart-testing-bearbinary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agentic-jumpstart-testing
Source: https://github.com/bearbinary/Jarvy/tree/main/.claude/skills/agentic-jumpstart-testing
Command: npx skills add https://github.com/bearbinary/Jarvy --skill agentic-jumpstart-testing-bearbinary

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines and patterns for effectively testing the Jarvy CLI, ensuring robustness and reliability across different environments.

Core Features & Use Cases

  • Test Organization: Understand where to place unit and integration tests.
  • Environment Variables: Learn how to control test behavior with specific environment flags like JARVY_TEST_MODE.
  • Test Utilities: Utilize helper functions like make_config for isolated test setups.
  • Integration Testing: Implement tests using assert_cmd for CLI interactions and assertions.
  • Platform-Specific Testing: Write tests that adapt to macOS, Linux, and Windows.
  • CI/CD Integration: Configure GitHub Actions for automated testing and coverage reporting.

Quick Start

Run all Jarvy CLI tests with cargo test --verbose -- --show-output.

Frequently Asked Questions about agentic-jumpstart-testing

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

FAQPage Schema
How do I organize unit and integration tests for a Rust CLI project?

Unit tests for a Rust CLI belong inside the src directory next to the code they test, while integration tests go in the top-level tests folder to verify the binary's external behavior.

How do I test CLI commands using assert_cmd and predicates in Rust?

Testing CLI commands with assert_cmd involves spawning your binary, passing arguments, and using predicates to assert on stdout, stderr, and exit codes. This approach validates end-to-end command interactions robustly.

How do I control test behavior with environment variables in Rust testing?

Control test behavior by setting environment flags like JARVY_TEST_MODE before executing tests. This switches the CLI into a test mode, allowing safe execution of commands without triggering real side effects.

How do I write platform-specific tests with conditional compilation in Rust?

Platform-specific tests use conditional compilation attributes like #[cfg(target_os = "linux")] to isolate tests for macOS, Linux, and Windows. This ensures tests only run when the matching platform dependencies are present.

How do I configure GitHub Actions for automated Rust testing and coverage?

Configure GitHub Actions by setting up a Rust toolchain workflow that runs cargo test on push and pull requests. You can integrate tools to automatically generate and upload coverage reports for your CI pipeline.

Can I use helper functions for isolated test setups in Rust integration tests?

Yes, you can use utility helper functions like make_config to generate isolated test setups. This standardizes configuration creation across integration tests, ensuring a clean and consistent environment for each run.