run-tests

Run Go unit tests, integration tests, and benchmarks via task commands.

1|1|Updated Dec 16, 2023
One-click install
npx skills add https://github.com/sjtw/tarkov-build-optimiser --skill run-tests-sjtw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-tests
Source: https://github.com/sjtw/tarkov-build-optimiser/tree/main/.cursor/skills/run-tests
Command: npx skills add https://github.com/sjtw/tarkov-build-optimiser --skill run-tests-sjtw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Run the appropriate test suite based on what you're testing and whether you need database access.

Core Features & Use Cases

  • Supports unit tests, integration tests, and benchmarks for Go projects.
  • Guides test discovery, naming conventions, and execution workflows across local and containerized environments.
  • Provides clear guidance on when to use unit tests vs integration tests vs benchmarks, and how to structure tests for CI/dev setups.

Quick Start

Choose the correct test scope (unit, integration, or all tests) and run the corresponding task command.

Frequently Asked Questions about run-tests

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

FAQPage Schema
How do I run the appropriate Go tests based on whether they need database access?

To run Go tests based on database needs, you select the correct test scope (unit, integration, or all) and execute the corresponding task command. This isolates tests requiring database connections from unit tests for deterministic execution.

What is the difference between unit tests and integration tests when structuring a Go project?

The difference between unit tests and integration tests is that unit tests validate isolated logic without external dependencies, while integration tests require database connections. This distinction guides naming conventions and test discovery workflows to ensure fast, deterministic execution.

How do I execute Go benchmarks alongside unit and integration tests?

To execute Go benchmarks alongside other tests, you apply the benchmark workflow provided by the task command. This integrates benchmark execution with standard test discovery, ensuring performance tests run deterministically across local and containerized environments.

Can I run tests via task and go test commands inside a DevContainer?

Yes, you can run tests via task and go test commands inside a DevContainer. The workflow guides test discovery and execution across containerized environments, ensuring consistent test results between local development setups and CI pipelines.

What's the best way to organize test discovery and naming conventions for Go?

The best way to organize test discovery and naming conventions for Go is to categorize tests into unit, integration, and benchmark scopes. Applying the specified task commands ensures fast, deterministic test execution tailored to each scope's requirements.