-
Notifications
You must be signed in to change notification settings - Fork 8
Make the runner mode argument mandatory and enable perf by default #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GuillaumeLagrange
merged 3 commits into
main
from
cod-1286-make-the-runner-mode-required-and-enable-perf-by-default-in
Sep 1, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # AGENTS.md | ||
|
|
||
| This file provides guidance to AI coding agents when working with code in this repository. | ||
|
|
||
| ## Overview | ||
|
|
||
| CodSpeed Runner is a Rust CLI application for gathering performance data and uploading reports to CodSpeed. The binary is named `codspeed` and supports local and CI environments including GitHub Actions, GitLab CI, and Buildkite. | ||
|
|
||
| ## Common Development Commands | ||
|
|
||
| ### Building and Testing | ||
| ```bash | ||
| # Build the project | ||
| cargo build | ||
|
|
||
| # Build in release mode | ||
| cargo build --release | ||
|
|
||
| # Run tests | ||
| cargo test | ||
|
|
||
| # Run specific test | ||
| cargo test <test_name> | ||
|
|
||
| # Run tests with output | ||
| cargo test -- --nocapture | ||
| ``` | ||
|
|
||
| ### Running the Application | ||
| ```bash | ||
| # Build and run | ||
| cargo run -- <subcommand> <args> | ||
|
|
||
| # Examples: | ||
| cargo run -- auth login | ||
| cargo run -- run "cargo bench" | ||
| cargo run -- setup | ||
| ``` | ||
|
|
||
| ### Code Quality | ||
| ```bash | ||
| # Check code without building | ||
| cargo check | ||
|
|
||
| # Format code | ||
| cargo fmt | ||
|
|
||
| # Run linter | ||
| cargo clippy | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| The application follows a modular structure: | ||
|
|
||
| ### Core Modules | ||
| - **`main.rs`**: Entry point with error handling and logging setup | ||
| - **`app.rs`**: CLI definition using clap with subcommands (Run, Auth, Setup) | ||
| - **`api_client.rs`**: CodSpeed GraphQL API client | ||
| - **`auth.rs`**: Authentication management | ||
| - **`config.rs`**: Configuration loading and management | ||
|
|
||
| ### Run Module (`src/run/`) | ||
| The core functionality for running benchmarks: | ||
| - **`run_environment/`**: CI provider implementations (GitHub Actions, GitLab CI, Buildkite, local) | ||
| - **`runner/`**: Execution modes: | ||
| - **`valgrind/`**: Instrumentation mode using custom Valgrind | ||
| - **`wall_time/perf/`**: Walltime mode with perf integration | ||
| - **`uploader/`**: Results upload to CodSpeed | ||
|
|
||
| ### Key Dependencies | ||
| - `clap`: CLI framework with derive macros | ||
| - `tokio`: Async runtime (current_thread flavor) | ||
| - `reqwest`: HTTP client with middleware/retry | ||
| - `serde`/`serde_json`: Serialization | ||
| - `gql_client`: Custom GraphQL client | ||
| - Platform-specific: `procfs` (Linux), `linux-perf-data` | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| - `CODSPEED_LOG`: Set logging level (debug, info, warn, error) | ||
| - `CODSPEED_API_URL`: Override API endpoint (default: https://gql.codspeed.io/) | ||
| - `CODSPEED_OAUTH_TOKEN`: Authentication token | ||
|
|
||
| ## Testing | ||
|
|
||
| The project uses: | ||
| - Standard Rust `cargo test` | ||
| - `insta` for snapshot testing | ||
| - `rstest` for parameterized tests | ||
| - `temp-env` for environment variable testing | ||
|
|
||
| Test files include snapshots in `snapshots/` directories for various run environment providers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.