Skip to content
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

Run test in CI #6

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
- uses: actions/checkout@main
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run `cargo check`
run: nix develop --command cargo check
- name: Set up nix dev env
run: nix develop --command echo 0
- name: Run `cargo build`
run: nix develop --command cargo build
- name: Run `cargo clippy`
run: nix develop --command cargo clippy --all-targets -- -D warnings
- name: Run `cargo test`
run: nix develop --command cargo test
- name: Run `cargo fmt`
run: nix develop --command cargo fmt --check
- name: Run `nix fmt`
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct Cli {
)]
show_unwind_info: Option<String>,
/// Show build ID for given binary
#[arg(long, value_name = "PATH_TO_BINARY",
#[arg(long, value_name = "PATH_TO_BINARY",
conflicts_with_all = ["pids", "tids", "duration", "filter_logs",
"sample_freq", "flamegraph_file"]
)]
Expand Down Expand Up @@ -163,7 +163,7 @@ mod tests {

cmd.arg("--help");
let expected = expect![[r#"
"Usage: lightswitch [OPTIONS]\n\nOptions:\n --pids <PIDS>\n Specific PIDs to profile\n --tids <TIDS>\n Specific TIDs to profile (these can be outside the PIDs selected above)\n --show-unwind-info <PATH_TO_BINARY>\n Show unwind info for given binary\n --show-info <PATH_TO_BINARY>\n Show build ID for given binary\n -D, --duration <DURATION>\n How long this agent will run in seconds [default: 18446744073709551615]\n --filter-logs\n \n --sample-freq <SAMPLE_FREQ_IN_HZ>\n Per-CPU Sampling Frequency in Hz [default: 19]\n --flamegraph-file <FLAMEGRAPH_FILE>\n Output file for Flame Graph in SVG format [default: flame.svg]\n -h, --help\n Print help\n"
"Usage: lightswitch [OPTIONS]\n\nOptions:\n --pids <PIDS>\n Specific PIDs to profile\n --tids <TIDS>\n Specific TIDs to profile (these can be outside the PIDs selected above)\n --show-unwind-info <PATH_TO_BINARY>\n Show unwind info for given binary\n --show-info <PATH_TO_BINARY>\n Show build ID for given binary\n -D, --duration <DURATION>\n How long this agent will run in seconds [default: 18446744073709551615]\n --filter-logs\n Enable TRACE (max) level logging - defaults to INFO level otherwise\n --sample-freq <SAMPLE_FREQ_IN_HZ>\n Per-CPU Sampling Frequency in Hz [default: 19]\n --flamegraph-file <FLAMEGRAPH_FILE>\n Output file for Flame Graph in SVG format [default: flame.svg]\n -h, --help\n Print help\n"
"#]];
cmd.assert().success();
let actual = String::from_utf8(cmd.unwrap().stdout).unwrap();
Expand Down