-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4a5403
commit 669304a
Showing
10 changed files
with
480 additions
and
21 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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
14 changes: 14 additions & 0 deletions
14
pyroscope_cli/tests/cli-ui/pyroscope_cli_completion_cmd_bash_cmd_stdout.toml
This file contains 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,14 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["completion", "bash", "--help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli-completion-bash | ||
generate the autocompletion script for bash | ||
USAGE: | ||
pyroscope-cli completion bash | ||
OPTIONS: | ||
-h, --help Print help information | ||
""" | ||
stderr = "" |
22 changes: 22 additions & 0 deletions
22
pyroscope_cli/tests/cli-ui/pyroscope_cli_completion_cmd_stdout.toml
This file contains 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,22 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["completion", "--help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli-completion | ||
Generate the autocompletion script for pyroscope for the specified shell. See each sub-command's | ||
help for details on how to use the generated script. | ||
USAGE: | ||
pyroscope-cli completion <SUBCOMMAND> | ||
OPTIONS: | ||
-h, --help Print help information | ||
SUBCOMMANDS: | ||
bash generate the autocompletion script for bash | ||
fish generate the autocompletion script for fish | ||
powershell generate the autocompletion script for powershell | ||
zsh generate the autocompletion script for zsh | ||
help Print this message or the help of the given subcommand(s) | ||
""" | ||
stderr = "" |
69 changes: 69 additions & 0 deletions
69
pyroscope_cli/tests/cli-ui/pyroscope_cli_connect_cmd_stdout.toml
This file contains 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,69 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["connect", "--help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli-connect | ||
Connect to an existing process and profile it | ||
USAGE: | ||
pyroscope-cli connect [OPTIONS] --pid <PID> --spy-name <SPY_NAME> | ||
OPTIONS: | ||
--application-name <APPLICATION_NAME> | ||
application name used when uploading profiling data | ||
--auth-token <AUTH_TOKEN> | ||
Authentication token used when uploading profiling data | ||
--basic-auth-username <BASIC_AUTH_USERNAME> | ||
HTTP Basic Authentication username used when uploading profiling data | ||
--basic-auth-password <BASIC_AUTH_PASSWORD> | ||
HTTP Basic Authentication password used when uploading profiling data | ||
--scope-org-id <SCOPE_ORG_ID> | ||
X-Scope-OrgID header for phlare multi-tenancy | ||
--detect-subprocesses | ||
keep track of and profile subprocesses of the main process | ||
-l, --log-level <LOG_LEVEL> | ||
[default: info] log level for the application [possible values: trace, debug, info, | ||
warn, error, critical] | ||
--pid <PID> | ||
PID of the process you want to profile. Pass -1 to profile the whole system (only | ||
supported by ebpfspy) | ||
--blocking | ||
enable blocking mode. [supported by: rbspy, pyspy] | ||
--oncpu | ||
enable oncpu mode. [supported by: rbspy, pyspy] | ||
--pyspy-gil | ||
enable GIL mode for pyspy | ||
--pyspy-native | ||
enable native extensions profiling for pyspy | ||
--sample-rate <SAMPLE_RATE> | ||
[default: 100] sample rate for the profiler in Hz. 100 means reading 100 times per | ||
second | ||
--server-address <SERVER_ADDRESS> | ||
[default: http://localhost:4040] Pyroscope server address | ||
--spy-name <SPY_NAME> | ||
name of the profiler to use [possible values: rbspy, pyspy] | ||
--tag <TAG> | ||
tag in key=value form. The flag may be specified multiple times | ||
--http_header <HTTP_HEADER> | ||
http header in 'X-Header: HeaderValue' form. The flag may be specified multiple times | ||
-h, --help | ||
Print help information | ||
""" | ||
stderr = "" |
74 changes: 74 additions & 0 deletions
74
pyroscope_cli/tests/cli-ui/pyroscope_cli_exec_cmd_stdout.toml
This file contains 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,74 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["exec", "--help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli-exec | ||
Start a new process from arguments and profile it | ||
USAGE: | ||
pyroscope-cli exec [OPTIONS] --spy-name <SPY_NAME> <COMMAND>... | ||
ARGS: | ||
<COMMAND>... command to execute | ||
OPTIONS: | ||
--application-name <APPLICATION_NAME> | ||
application name used when uploading profiling data | ||
--auth-token <AUTH_TOKEN> | ||
Authentication token used when uploading profiling data | ||
--basic-auth-username <BASIC_AUTH_USERNAME> | ||
HTTP Basic Authentication username used when uploading profiling data | ||
--basic-auth-password <BASIC_AUTH_PASSWORD> | ||
HTTP Basic Authentication password used when uploading profiling data | ||
--scope-org-id <SCOPE_ORG_ID> | ||
X-Scope-OrgID header for phlare multi-tenancy | ||
--detect-subprocesses | ||
keep track of and profile subprocesses of the main process | ||
-l, --log-level <LOG_LEVEL> | ||
[default: info] log level for the application [possible values: trace, debug, info, | ||
warn, error, critical] | ||
--blocking | ||
enable blocking mode. [supported by: rbspy, pyspy] | ||
--oncpu | ||
enable oncpu mode. [supported by: rbspy, pyspy] | ||
--pyspy-gil | ||
enable GIL mode for pyspy | ||
--pyspy-native | ||
enable native extensions profiling for pyspy | ||
--sample-rate <SAMPLE_RATE> | ||
[default: 100] sample rate for the profiler in Hz. 100 means reading 100 times per | ||
second | ||
--server-address <SERVER_ADDRESS> | ||
[default: http://localhost:4040] Pyroscope server address | ||
--spy-name <SPY_NAME> | ||
name of the profiler to use [possible values: rbspy, pyspy] | ||
--tag <TAG> | ||
tag in key=value form. The flag may be specified multiple times | ||
--http_header <HTTP_HEADER> | ||
http header in 'X-Header: HeaderValue' form. The flag may be specified multiple times | ||
--user-name <USER_NAME> | ||
start process under specified user name | ||
--group-name <GROUP_NAME> | ||
start process under specified group name | ||
-h, --help | ||
Print help information | ||
""" | ||
stderr = "" |
33 changes: 33 additions & 0 deletions
33
pyroscope_cli/tests/cli-ui/pyroscope_cli_help_cmd_stdout.toml
This file contains 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,33 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli 0.2.3 | ||
Abid Omar <[email protected]> | ||
Pyroscope CLI | ||
USAGE: | ||
pyroscope-cli [OPTIONS] <SUBCOMMAND> | ||
OPTIONS: | ||
-c, --config <FILE> | ||
Set a custom config file | ||
-h, --help | ||
Print help information | ||
-V, --version | ||
Print version information | ||
SUBCOMMANDS: | ||
completion | ||
Generate the autocompletion script for pyroscope for the specified shell. See each | ||
sub-command's help for details on how to use the generated script. | ||
connect | ||
Connect to an existing process and profile it | ||
exec | ||
Start a new process from arguments and profile it | ||
help | ||
Print this message or the help of the given subcommand(s) | ||
""" | ||
stderr = "" |
33 changes: 33 additions & 0 deletions
33
pyroscope_cli/tests/cli-ui/pyroscope_cli_help_flag_stdout.toml
This file contains 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,33 @@ | ||
bin.name = "pyroscope-cli" | ||
args = ["--help"] | ||
status.code = 0 | ||
stdout = """ | ||
pyroscope-cli 0.2.3 | ||
Abid Omar <[email protected]> | ||
Pyroscope CLI | ||
USAGE: | ||
pyroscope-cli [OPTIONS] <SUBCOMMAND> | ||
OPTIONS: | ||
-c, --config <FILE> | ||
Set a custom config file | ||
-h, --help | ||
Print help information | ||
-V, --version | ||
Print version information | ||
SUBCOMMANDS: | ||
completion | ||
Generate the autocompletion script for pyroscope for the specified shell. See each | ||
sub-command's help for details on how to use the generated script. | ||
connect | ||
Connect to an existing process and profile it | ||
exec | ||
Start a new process from arguments and profile it | ||
help | ||
Print this message or the help of the given subcommand(s) | ||
""" | ||
stderr = "" |
This file contains 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,7 @@ | ||
#[test] | ||
fn cli_ui_doc_text_tests() { | ||
let t = trycmd::TestCases::new(); | ||
let cli = trycmd::cargo::cargo_bin("pyroscope-cli"); | ||
t.register_bin("pyroscope-cli", &cli); | ||
t.case("tests/cli-ui/*.toml"); | ||
} |