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

fix: remove token check for report #461

Merged
merged 3 commits into from
Jun 21, 2024
Merged

Conversation

thomasrockhu-codecov
Copy link
Contributor

No description provided.

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

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

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('66bc40f0-f227-483d-a5d0-7482944bc603'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

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

def test_report_results_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('16419e47-797f-4478-8939-ff2d836d252c'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ea7d1a9d0>
capsys = <pytest.capture.CaptureFixture object at 0x7f4ea7d1aa60>

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200,
text='{"state": "completed", "result": {"state": "failure","message": "33.33% of diff hit (target 77.77%)"}}',
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('b3106ae7-023c-4a9a-8309-90bd3769c0d6'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ea7fcfe80>
capsys = <pytest.capture.CaptureFixture object at 0x7f4ea7fcffd0>

@patch("codecov_cli.services.report.MAX_NUMBER_TRIES", 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch("codecov_cli.services.report.time.sleep")
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "pending", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('46ed0f79-ea43-40ae-9a79-e5b198bffaf6'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ea7dd1040>
capsys = <pytest.capture.CaptureFixture object at 0x7f4ea7fcff70>

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "error", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('49aee33d-a5af-456c-85b7-f70645aa820a'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ea8041160>
capsys = <pytest.capture.CaptureFixture object at 0x7f4ea7fb0d30>

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "undefined_state", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('0c84829c-3736-4041-98b1-23424f53cb76'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ea7ed7c40>
capsys = <pytest.capture.CaptureFixture object at 0x7f4ea7ed7b20>

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=401, text='{"detail": "Invalid token."}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('060fa203-72bd-49f4-969f-a38cf6741fe0'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
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 691 tests with 8 failed, 683 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

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

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('056f1159-38d5-44b0-b3e1-623dc3accdda'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

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

def test_report_results_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('e12608bf-c73c-4094-9849-a99b743fd57c'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f578bb629b0>
capsys = <pytest.capture.CaptureFixture object at 0x7f578bb626e0>

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200,
text='{"state": "completed", "result": {"state": "failure","message": "33.33% of diff hit (target 77.77%)"}}',
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('61907f49-4dbb-4161-98f2-6278fd177b7b'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f578bcf84f0>
capsys = <pytest.capture.CaptureFixture object at 0x7f578bcf8430>

@patch("codecov_cli.services.report.MAX_NUMBER_TRIES", 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch("codecov_cli.services.report.time.sleep")
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "pending", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('ce564ad8-ac76-4062-8144-03ad62231754'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f578c0a4a00>
capsys = <pytest.capture.CaptureFixture object at 0x7f578c0a43d0>

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "error", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('8191f383-145d-4eb2-a180-0c34aeebc31f'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f578bb2b880>
capsys = <pytest.capture.CaptureFixture object at 0x7f578bb2b430>

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "undefined_state", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('056ac121-0b83-4657-a85a-0587e7cd73a0'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f578bc98250>
capsys = <pytest.capture.CaptureFixture object at 0x7f578bc98610>

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=401, text='{"detail": "Invalid token."}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('e3102f8d-f23e-485b-abb1-02d68ac5c101'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
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 691 tests with 8 failed, 683 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

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

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('c33f5326-3bcb-4be3-bfac-d8a2a581d84c'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

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

def test_report_results_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('f3730fdb-1324-4500-a551-618fa7b5eaf3'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb213097640>
capsys = <pytest.capture.CaptureFixture object at 0x7fb213097ca0>

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200,
text='{"state": "completed", "result": {"state": "failure","message": "33.33% of diff hit (target 77.77%)"}}',
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('92c56720-025f-46e1-aa87-fb4446217e8c'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb21312dc70>
capsys = <pytest.capture.CaptureFixture object at 0x7fb21312d220>

@patch("codecov_cli.services.report.MAX_NUMBER_TRIES", 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch("codecov_cli.services.report.time.sleep")
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "pending", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('0cdc785f-d6b1-4ab1-b9f4-99b3be20eb71'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb2134312e0>
capsys = <pytest.capture.CaptureFixture object at 0x7fb213431c70>

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "error", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('dd56bca5-703e-4538-8d7e-16d71331043b'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb213421d00>
capsys = <pytest.capture.CaptureFixture object at 0x7fb2132a1df0>

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "undefined_state", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('7f7b8a90-c1a3-4716-9c81-c235e17eae80'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb213126e20>
capsys = <pytest.capture.CaptureFixture object at 0x7fb213126700>

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=401, text='{"detail": "Invalid token."}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('cf3f9f20-2041-4103-a9f6-08a733b70cb9'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
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 691 tests with 8 failed, 683 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.services.report.test_report_results::test_report_results_request_200

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

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('75ee5d1d-72e7-4911-a664-b2dc6a8ec9a7'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

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

def test_report_results_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('3e83c748-54aa-4f1b-b37f-3121c184937f'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f8eb2e0be90>
capsys = <pytest.capture.CaptureFixture object at 0x7f8eb2e0b0d0>

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200,
text='{"state": "completed", "result": {"state": "failure","message": "33.33% of diff hit (target 77.77%)"}}',
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('1f664b38-a1fe-4425-8707-1ed9706bcc83'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f8eb2e44850>
capsys = <pytest.capture.CaptureFixture object at 0x7f8eb2e45f10>

@patch("codecov_cli.services.report.MAX_NUMBER_TRIES", 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch("codecov_cli.services.report.time.sleep")
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "pending", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('9ac6918b-395a-4498-909c-d23a3c64295c'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f8eb30fce90>
capsys = <pytest.capture.CaptureFixture object at 0x7f8eb30fc2d0>

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "error", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('54d9b88b-9215-4fc5-bb7b-779b25284467'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f8eb2f67710>
capsys = <pytest.capture.CaptureFixture object at 0x7f8eb2f66a90>

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "undefined_state", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('bab1465d-bf4d-4e27-ab63-d785177bae37'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f8eb2e58790>
capsys = <pytest.capture.CaptureFixture object at 0x7f8eb2e5abd0>

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=401, text='{"detail": "Invalid token."}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('c20a4499-65a7-433a-a145-06784519d986'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

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

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('11454efa-1968-4bda-820e-396a45e80d4d'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

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

def test_report_results_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = send_reports_result_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('5edff469-a5c2-45c9-b8f0-cb5b17d87d12'), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4d966011c0>
capsys = <pytest.capture.CaptureFixture object at 0x7f4d966018b0>

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200,
text='{"state": "completed", "result": {"state": "failure","message": "33.33% of diff hit (target 77.77%)"}}',
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('7e828e9a-1c39-4979-988f-dfe2426d17c5'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4d965193a0>
capsys = <pytest.capture.CaptureFixture object at 0x7f4d9651aa80>

@patch("codecov_cli.services.report.MAX_NUMBER_TRIES", 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch("codecov_cli.services.report.time.sleep")
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "pending", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('8ac41011-26dc-4b04-a1d9-9f1fbc73ecd9'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4d96569df0>
capsys = <pytest.capture.CaptureFixture object at 0x7f4d96569af0>

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "error", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('0c80eab7-7eef-4a67-aef5-dfb8a773f0f0'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4d9650b200>
capsys = <pytest.capture.CaptureFixture object at 0x7f4d965091f0>

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=200, text='{"state": "undefined_state", "result": {}}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('f1632d65-a794-481b-953a-ca2140621041'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4d96505580>
capsys = <pytest.capture.CaptureFixture object at 0x7f4d965056a0>

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
"codecov_cli.services.report.requests.get",
return_value=mocker.MagicMock(
status_code=401, text='{"detail": "Invalid token."}'
),
)
token = uuid.uuid4()
> res = send_reports_result_get_request(
"commit_sha", "report_code", "encoded_slug", "service", token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = 'commit_sha', report_code = 'report_code'
encoded_slug = 'encoded_slug', service = 'service'
token = UUID('db685af0-daf6-4267-b222-8d797784ed2f'), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
> headers = get_token_header_or_fail(token)
E NameError: name 'get_token_header_or_fail' is not defined

.../services/report/init.py:98: NameError
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 Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.98%. Comparing base (08c5a7d) to head (95d25d4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #461   +/-   ##
=======================================
  Coverage   95.98%   95.98%           
=======================================
  Files          83       83           
  Lines        2938     2938           
=======================================
  Hits         2820     2820           
  Misses        118      118           
Flag Coverage Δ
python3.10 96.25% <100.00%> (ø)
python3.11 96.25% <100.00%> (ø)
python3.12 96.25% <100.00%> (ø)
python3.8 96.22% <100.00%> (ø)
python3.9 96.22% <100.00%> (ø)
smart-labels 95.94% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 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
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4a15760&gt;

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;274053fb-7794-4535-adce-4f177547ccb8&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4c12430&gt;

def test_report_results_403(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=403, text=&quot;Permission denied&quot;),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;c9f40c76-a10f-4d51-b363-358868e2784d&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4da79a0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f67f4da73a0&gt;

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200,
text=&apos;{&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: {&quot;state&quot;: &quot;failure&quot;,&quot;message&quot;: &quot;33.33% of diff hit (target 77.77%)&quot;}}&apos;,
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;92e6514c-626d-4821-a34c-a116a2f68956&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4da7850&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f67f4df73a0&gt;

@patch(&quot;codecov_cli.services.report.MAX_NUMBER_TRIES&quot;, 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch(&quot;codecov_cli.services.report.time.sleep&quot;)
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;pending&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;5e21ef02-8f44-48e7-a851-b40a5d6af112&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4c64c70&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f67f4cfa970&gt;

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;error&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;9cf79daf-34cc-4431-84bf-cd04c5d85e4e&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4becd00&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f67f4beca00&gt;

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;undefined_state&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;14bdf1a3-9ec8-46cc-8336-2dd915b16c44&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f67f4c4ab50&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f67f4c4ad00&gt;

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=401, text=&apos;{&quot;detail&quot;: &quot;Invalid token.&quot;}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;47923455-c20b-4973-b18d-73858d87d5df&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 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
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab577c990&gt;

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;46004451-2dc8-41c8-a6c9-0f020a369291&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab58a88d0&gt;

def test_report_results_403(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=403, text=&quot;Permission denied&quot;),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;b61de833-538c-44aa-951b-c675143d8f1c&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab58527d0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7fbab58524d0&gt;

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200,
text=&apos;{&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: {&quot;state&quot;: &quot;failure&quot;,&quot;message&quot;: &quot;33.33% of diff hit (target 77.77%)&quot;}}&apos;,
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;c157a3de-ca53-4e68-86dd-18d41c8a899c&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab5733010&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7fbab5733150&gt;

@patch(&quot;codecov_cli.services.report.MAX_NUMBER_TRIES&quot;, 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch(&quot;codecov_cli.services.report.time.sleep&quot;)
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;pending&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;f5bd195a-6e35-4454-ad52-c7418fabdf55&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab577d950&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7fbab577e3d0&gt;

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;error&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;b92af2ce-21ef-444c-9792-11acad6f1058&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab5704090&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7fbab57205d0&gt;

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;undefined_state&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;5c1cdb56-575e-4132-8a59-c84afdfb8907&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7fbab5732750&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7fbab57325d0&gt;

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=401, text=&apos;{&quot;detail&quot;: &quot;Invalid token.&quot;}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;5f91015c-c54c-4052-a7b8-c9a58967351f&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 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
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f782176a0&gt;

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;e2bf8d6b-d784-4f8c-a037-e0ca2e27d5d4&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f78426d40&gt;

def test_report_results_403(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=403, text=&quot;Permission denied&quot;),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;6815fc80-fcd2-4670-bebb-888882c2ef72&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f7827e590&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f6f7827e4d0&gt;

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200,
text=&apos;{&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: {&quot;state&quot;: &quot;failure&quot;,&quot;message&quot;: &quot;33.33% of diff hit (target 77.77%)&quot;}}&apos;,
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;413ad4d1-0f68-4d8d-a173-6c731e0ce1c4&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f783f7e80&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f6f783f7ee0&gt;

@patch(&quot;codecov_cli.services.report.MAX_NUMBER_TRIES&quot;, 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch(&quot;codecov_cli.services.report.time.sleep&quot;)
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;pending&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;5e34f808-47f9-43fb-964d-58c69f12a64e&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f784008b0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f6f78402710&gt;

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;error&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;78a58c28-ed41-4f2e-9699-1773ba71a22e&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f78246f20&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f6f78247dc0&gt;

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;undefined_state&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;cda05dc5-dd54-4a20-8d2b-b720ec27dfae&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f6f78239ed0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f6f7823bfa0&gt;

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=401, text=&apos;{&quot;detail&quot;: &quot;Invalid token.&quot;}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;2db6f01a-91e9-4cc2-ba28-79dd015916a4&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 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
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e83a9f0&gt;

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;c22f1f42-5bdd-4595-a6c9-1f8d9778fcb2&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined. Did you forget to import &apos;os&apos;

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e838080&gt;

def test_report_results_403(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=403, text=&quot;Permission denied&quot;),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;dd6d31f7-c1dd-41ec-8071-acc2cebb3cd9&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined. Did you forget to import &apos;os&apos;

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e86b200&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f970e86bce0&gt;

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200,
text=&apos;{&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: {&quot;state&quot;: &quot;failure&quot;,&quot;message&quot;: &quot;33.33% of diff hit (target 77.77%)&quot;}}&apos;,
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;08a9bbb0-bf46-4685-a8a6-eaf001b0ee0a&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e829f40&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f970e829e20&gt;

@patch(&quot;codecov_cli.services.report.MAX_NUMBER_TRIES&quot;, 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch(&quot;codecov_cli.services.report.time.sleep&quot;)
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;pending&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;f62600db-b96e-4ba0-ba1f-11c8b40fc144&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e879ca0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f970e8795b0&gt;

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;error&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;1de371f3-f159-4c15-89af-ce0d9e9341e5&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e8236e0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f970e823b60&gt;

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;undefined_state&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;c63d35a6-8936-4829-8865-6c21336c8459&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f970e803da0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f970e801b20&gt;

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=401, text=&apos;{&quot;detail&quot;: &quot;Invalid token.&quot;}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;2191ad0a-fcda-4f1f-87b1-f093e0a9fdbc&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError

Copy link

❌ Failed Test Results:

Completed 691 tests with 8 failed, 683 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.report.test_report_results::test_report_results_request_200

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f782a197040&gt;

def test_report_results_request_200(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=200),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;0252283a-473c-4f7a-8f53-0df8c97190d1&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_report_results_403

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f782a12faf0&gt;

def test_report_results_403(mocker):
mocked_response = mocker.patch(
&quot;codecov_cli.helpers.request.requests.post&quot;,
return_value=mocker.MagicMock(status_code=403, text=&quot;Permission denied&quot;),
)
token = uuid.uuid4()
&gt; res = send_reports_result_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;dbc213af-62cc-4dbd-a35f-15816839943e&apos;), enterprise_url = None

def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
&gt; tokenless = os.environ.get(&quot;TOKENLESS&quot;)
E NameError: name &apos;os&apos; is not defined

.../services/report/init.py:83: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_completed

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f7829febf70&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f7829feba60&gt;

def test_get_report_results_200_completed(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200,
text=&apos;{&quot;state&quot;: &quot;completed&quot;, &quot;result&quot;: {&quot;state&quot;: &quot;failure&quot;,&quot;message&quot;: &quot;33.33% of diff hit (target 77.77%)&quot;}}&apos;,
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;c7af9c43-37f3-4546-b674-aa82b5966a21&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_pending

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f7829f494c0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f7829f49550&gt;

@patch(&quot;codecov_cli.services.report.MAX_NUMBER_TRIES&quot;, 1)
def test_get_report_results_200_pending(mocker, capsys):
mocker.patch(&quot;codecov_cli.services.report.time.sleep&quot;)
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;pending&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;07d60aa2-651e-45ba-99bc-aaaac8fb59b9&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_error

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f7829ff49a0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f7829ff4be0&gt;

def test_get_report_results_200_error(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;error&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;17ab9037-1ff8-4443-8e6a-255385905b8f&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_200_undefined_state

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f782a0f7ca0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f782a0f7160&gt;

def test_get_report_results_200_undefined_state(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=200, text=&apos;{&quot;state&quot;: &quot;undefined_state&quot;, &quot;result&quot;: {}}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;acbd933e-5317-438b-8e49-4912ee23cbc7&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
Testsuite:
tests.services.report.test_report_results::test_get_report_results_401

Test name:
pytest
mocker = &lt;pytest_mock.plugin.MockerFixture object at 0x7f7829ff37f0&gt;
capsys = &lt;pytest.capture.CaptureFixture object at 0x7f7829ff3c10&gt;

def test_get_report_results_401(mocker, capsys):
mocked_response = mocker.patch(
&quot;codecov_cli.services.report.requests.get&quot;,
return_value=mocker.MagicMock(
status_code=401, text=&apos;{&quot;detail&quot;: &quot;Invalid token.&quot;}&apos;
),
)
token = uuid.uuid4()
&gt; res = send_reports_result_get_request(
&quot;commit_sha&quot;, &quot;report_code&quot;, &quot;encoded_slug&quot;, &quot;service&quot;, token, None
)

.../services/report/test_report_results.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

commit_sha = &apos;commit_sha&apos;, report_code = &apos;report_code&apos;
encoded_slug = &apos;encoded_slug&apos;, service = &apos;service&apos;
token = UUID(&apos;ee430388-6e6a-440c-8268-c441b028b3b5&apos;), enterprise_url = None
fail_on_error = False

def send_reports_result_get_request(
commit_sha,
report_code,
encoded_slug,
service,
token,
enterprise_url,
fail_on_error=False,
):
&gt; headers = get_token_header_or_fail(token)
E NameError: name &apos;get_token_header_or_fail&apos; is not defined

.../services/report/init.py:104: NameError
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

@@ -80,7 +80,13 @@ def create_report_results_logic(
def send_reports_result_request(
commit_sha, report_code, encoded_slug, service, token, enterprise_url
):
headers = get_token_header_or_fail(token)
tokenless = os.environ.get("TOKENLESS")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the endpoint here supports this

@@ -8,7 +8,7 @@
from codecov_cli.helpers.config import CODECOV_API_URL
from codecov_cli.helpers.encoder import decode_slug, encode_slug
from codecov_cli.helpers.request import (
get_token_header_or_fail,
get_token_header,
Copy link
Contributor

Choose a reason for hiding this comment

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

we should still keep get_token_header_or_fail here

Copy link
Contributor

Choose a reason for hiding this comment

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

Your comment is conflicting with the code

Copy link
Contributor

Choose a reason for hiding this comment

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

there was an old version of the PR where get_token_header_or_fail was being deleted, i meant that we should keep both

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Copy link

❌ Failed Test Results:

Completed 691 tests with 1 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():
&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 691 tests with 1 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():
&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 691 tests with 1 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():
&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 691 tests with 1 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():
&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 691 tests with 1 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():
&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

@joseph-sentry joseph-sentry merged commit 084851e into main Jun 21, 2024
24 checks passed
@joseph-sentry joseph-sentry deleted the th/fix-report-tokenless branch June 21, 2024 14:52
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.

3 participants