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

chore: Fix helper text in label analysis #315

Merged
merged 2 commits into from
Nov 8, 2023
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: 3 additions & 5 deletions codecov_cli/commands/labelanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,16 @@
"--dry-run",
"dry_run",
help=(
"Print list of tests to run AND tests skipped (and options that need to be added to the test runner) to stdout. "
+ "Also prints the same information in JSON format. "
+ "JSON will have keys 'ats_tests_to_run', 'ats_tests_to_skip' and 'runner_options'. "
+ "List of tests to run is prefixed with ATS_TESTS_TO_RUN= "
+ "List of tests to skip is prefixed with ATS_TESTS_TO_SKIP="
"Print list of tests to run AND tests skipped AND options that need to be added to the test runner to stdout. "
+ "Choose format with --dry-run-format option. Default is JSON. "
thomasrockhu-codecov marked this conversation as resolved.
Show resolved Hide resolved
),
is_flag=True,
)
@click.option(
"--dry-run-format",
"dry_run_format",
type=click.Choice(["json", "space-separated-list"]),
help="Format in which --dry-run data is printed. Default is JSON.",
default="json",
)
@click.pass_context
Expand Down
32 changes: 0 additions & 32 deletions tests/commands/test_invoke_labelanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,38 +171,6 @@ def test__dry_run_space_separated_list_output(self):


class TestLabelAnalysisCommand(object):
def test_labelanalysis_help(self, mocker, fake_ci_provider):
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
runner = CliRunner()

result = runner.invoke(cli, ["label-analysis", "--help"], obj={})
assert result.exit_code == 0
print(result.output)
assert result.output.split("\n") == [
"Usage: cli label-analysis [OPTIONS]",
"",
"Options:",
" --token TEXT The static analysis token (NOT the same token",
" as upload) [required]",
" --head-sha TEXT Commit SHA (with 40 chars) [required]",
" --base-sha TEXT Commit SHA (with 40 chars) [required]",
" --runner-name, --runner TEXT Runner to use",
" --max-wait-time INTEGER Max time (in seconds) to wait for the label",
" analysis result before falling back to running",
" all tests. Default is to wait forever.",
" --dry-run Print list of tests to run AND tests skipped",
" (and options that need to be added to the test",
" runner) to stdout. Also prints the same",
" information in JSON format. JSON will have",
" keys 'ats_tests_to_run', 'ats_tests_to_skip'",
" and 'runner_options'. List of tests to run is",
" prefixed with ATS_TESTS_TO_RUN= List of tests",
" to skip is prefixed with ATS_TESTS_TO_SKIP=",
" --dry-run-format [json|space-separated-list]",
" -h, --help Show this message and exit.",
"",
]

def test_invoke_label_analysis_missing_token(self, mocker, fake_ci_provider):
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
runner = CliRunner()
Expand Down