Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
coralogix avatar

Run Tests

  • 406 installs
  • 113 repo stars
  • Updated August 4, 2026
  • coralogix/cx-cli

Run tests, lint, and formatting checks for the cx CLI Rust project using cargo test, cargo fmt, and cargo clippy.

About

Documents how to run and verify the cx CLI's Rust test suite, formatting, and clippy lint checks matching the CI sequence. A contributor uses it to verify code changes before committing or opening a PR.

  • Full CI check: cargo fmt --check && cargo clippy --locked -- -D warnings && cargo test --locked
  • Covers ignored integration tests and name-filtered runs

Run Tests by the numbers

  • 406 all-time installs (skills.sh)
  • Ranked #649 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/coralogix/cx-cli --skill run-tests

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs406
repo stars113
Last updatedAugust 4, 2026
Repositorycoralogix/cx-cli

What it does

Run tests, lint, and formatting checks for the cx CLI Rust project using cargo test, cargo fmt, and cargo clippy.

Files

SKILL.mdMarkdownGitHub ↗

Run Tests & Verify

How to run tests, lint, and verify changes in the cx CLI. This skill covers running only - for writing new tests, see the add-command skill.

Quick Reference

CommandWhat it does
cargo testRun all unit + integration tests
cargo test <name>Run tests matching a name substring
cargo test -- --ignoredRun integration tests (filesystem-dependent, skipped by default)
cargo fmt --checkCheck formatting (no changes)
cargo fmtAuto-fix formatting
cargo clippy --locked -- -D warningsLint with warnings-as-errors
cargo buildVerify compilation

Full CI Check

This is the exact sequence CI runs on every PR. Run it before committing or creating a PR:

cargo fmt --check && cargo clippy --locked -- -D warnings && cargo test --locked

The --locked flag ensures the lockfile is respected - this matches .github/workflows/test.yml and lint.yml exactly. CI runs tests on Ubuntu, macOS, and Windows.

What to Run After a Change

Pick the right level of verification based on what changed:

  • Any `.rs` file - cargo test + cargo clippy --locked -- -D warnings
  • Formatting only - cargo fmt --check (or cargo fmt to auto-fix)
  • `Cargo.toml` - full CI check (dependency changes affect everything)
  • API types (`src/commands/<cmd>/api.rs`) - run that command's tests first (cargo test alerts, cargo test dataprime), then the full suite
  • Test files only - cargo test <relevant_test_name>

Running Specific Tests

Target tests efficiently instead of running the entire suite:

  • cargo test alerts - all tests with "alerts" in the name
  • cargo test --test dataprime - only the tests/dataprime/ integration test binary (input + output + query)
  • cargo test --test dataprime input - only the input submodule of that binary
  • cargo test config::tests - only the tests in the config module
  • cargo test metrics::tests - only metrics formatting tests

Interpreting Failures

Clippy warnings - treated as errors via -D warnings. Fix every warning before committing. Common ones: unused variables, unnecessary clones, missing error handling.

Format failures - run cargo fmt to auto-fix. These never need manual intervention.

Deserialization test failures - usually means struct field names don't match JSON keys. Check that #[serde(rename_all = "camelCase")] is on response types and that #[serde(default)] is on Vec fields (the API sometimes omits empty arrays).

Compilation errors in tests - likely caused by changing a public function signature. Check callers in both src/ and tests/ directories.

Integration test failures (`--ignored`) - these depend on filesystem state (~/.cx/ config directory). They may fail if the local environment isn't set up. This is expected in CI where no config exists.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.