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: consistent naming of upload options #473

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

giovanni-guidini
Copy link
Contributor

Makes the --report-code of do-upload to also accept
--code. This makes it consistent with other commands.

closes codecov/feedback#380

Copy link

❌ Failed Test Results:

Completed 692 tests with 2 failed, 690 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_options

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f860a7a2ee0>

def test_upload_process_options(mocker):
runner = CliRunner()
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
with runner.isolated_filesystem():
runner = CliRunner()
result = runner.invoke(cli, ["upload-process", "-h"], obj={})
assert result.exit_code == 0
print(result.output)

> assert result.output.split("\n")[1:] == [
"Usage: cli upload-process [OPTIONS]",
"",
"Options:",
" -C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]",
" -Z, --fail-on-error Exit with non-zero code in case of error",
" --git-service [github

Copy link

❌ Failed Test Results:

Completed 692 tests with 2 failed, 690 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_options

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fcd8175b0a0>

def test_upload_process_options(mocker):
runner = CliRunner()
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
with runner.isolated_filesystem():
runner = CliRunner()
result = runner.invoke(cli, ["upload-process", "-h"], obj={})
assert result.exit_code == 0
print(result.output)

> assert result.output.split("\n")[1:] == [
"Usage: cli upload-process [OPTIONS]",
"",
"Options:",
" -C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]",
" -Z, --fail-on-error Exit with non-zero code in case of error",
" --git-service [github
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 692 tests with 2 failed, 690 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_options

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f5a129635d0>

def test_upload_process_options(mocker):
runner = CliRunner()
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
with runner.isolated_filesystem():
runner = CliRunner()
result = runner.invoke(cli, ["upload-process", "-h"], obj={})
assert result.exit_code == 0
print(result.output)

> assert result.output.split("\n")[1:] == [
"Usage: cli upload-process [OPTIONS]",
"",
"Options:",
" -C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]",
" -Z, --fail-on-error Exit with non-zero code in case of error",
" --git-service [github
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 692 tests with 2 failed, 690 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_options

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f08d9026140>

def test_upload_process_options(mocker):
runner = CliRunner()
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
with runner.isolated_filesystem():
runner = CliRunner()
result = runner.invoke(cli, ["upload-process", "-h"], obj={})
assert result.exit_code == 0
print(result.output)

> assert result.output.split("\n")[1:] == [
"Usage: cli upload-process [OPTIONS]",
"",
"Options:",
" -C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]",
" -Z, --fail-on-error Exit with non-zero code in case of error",
" --git-service [github

Copy link

❌ Failed Test Results:

Completed 692 tests with 2 failed, 690 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_options

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f29c6c86690>

def test_upload_process_options(mocker):
runner = CliRunner()
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)
with runner.isolated_filesystem():
runner = CliRunner()
result = runner.invoke(cli, ["upload-process", "-h"], obj={})
assert result.exit_code == 0
print(result.output)

> assert result.output.split("\n")[1:] == [
"Usage: cli upload-process [OPTIONS]",
"",
"Options:",
" -C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]",
" -Z, --fail-on-error Exit with non-zero code in case of error",
" --git-service [github
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Makes the `--report-code` of `do-upload` to also accept
`--code`. This makes it consistent with other commands.

closes codecov/feedback#380
Copy link

❌ Failed Test Results:

Completed 692 tests with 1 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

2 similar comments
Copy link

❌ Failed Test Results:

Completed 692 tests with 1 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 692 tests with 1 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

codecov bot commented Jul 15, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 3465 tests with 5 failed, 3460 passed and 0 skipped.

View the full list of failed tests

pytest

  • Class name: api.temp.calculator.test_calculator
    Test name: test_divide
    Flags:
    • python3.12

    def
    test_divide():
    > assert Calculator.divide(1, 2) == 0.5
    E assert 1.0 == 0.5
    E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
    E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
    .../temp/calculator/test_calculator.py:30: AssertionError
  • Class name: api.temp.calculator.test_calculator
    Test name: test_divide
    Flags:
    • python3.8

    def
    test_divide():
    > assert Calculator.divide(1, 2) == 0.5
    E assert 1.0 == 0.5
    E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
    E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
    .../temp/calculator/test_calculator.py:30: AssertionError
  • Class name: api.temp.calculator.test_calculator
    Test name: test_divide
    Flags:
    • python3.11

    def
    test_divide():
    > assert Calculator.divide(1, 2) == 0.5
    E assert 1.0 == 0.5
    E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
    E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
    .../temp/calculator/test_calculator.py:30: AssertionError
  • Class name: api.temp.calculator.test_calculator
    Test name: test_divide
    Flags:
    • python3.10

    def
    test_divide():
    > assert Calculator.divide(1, 2) == 0.5
    E assert 1.0 == 0.5
    E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
    E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
    .../temp/calculator/test_calculator.py:30: AssertionError
  • Class name: api.temp.calculator.test_calculator
    Test name: test_divide
    Flags:
    • python3.9

    def
    test_divide():
    > assert Calculator.divide(1, 2) == 0.5
    E assert 1.0 == 0.5
    E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
    E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
    .../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 692 tests with 1 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

1 similar comment
Copy link

❌ Failed Test Results:

Completed 692 tests with 1 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

@giovanni-guidini giovanni-guidini requested review from joseph-sentry and a team and removed request for joseph-sentry July 15, 2024 00:19
Swatinem
Swatinem previously approved these changes Jul 17, 2024
Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

4 similar comments
Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

4 similar comments
Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

4 similar comments
Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

Copy link

❌ Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
def
test_divide():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

@giovanni-guidini giovanni-guidini merged commit f509528 into main Jul 17, 2024
22 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/feedback-380 branch July 17, 2024 15:27
@@ -31,8 +31,7 @@ jobs:
- os: ubuntu-20.04
TARGET: ubuntu
CMD_REQS: >
pip install -r requirements.txt
pip install .
pip install -r requirements.txt && pip install .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giovanni-guidini FYI, both deps could be passed to the same pip install command. There's no technical reason for running it twice here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsitent naming of upload options for the codecov cli
3 participants