Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Reenable test - #1019

Open
tnt-sentry wants to merge 4 commits into
mainfrom
trent/reenable-test
Open

Reenable test#1019
tnt-sentry wants to merge 4 commits into
mainfrom
trent/reenable-test

Conversation

@tnt-sentry

Copy link
Copy Markdown
Contributor

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov

codecovBot commented Jan 21, 2025

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completedFailedPassedSkipped
1788117874
View the top 1 failed tests by shortest run time
tasks/tests/unit/test_upload_task.py::TestUploadTaskIntegration::test_upload_task_upload_processing_delay_upload_is_none
Stack Traces | 46.9s run time
self=<worker.tasks.tests.unit.test_upload_task.TestUploadTaskIntegrationobjectat0x7f8e47028050>mocker=<pytest_mock.plugin.MockFixtureobjectat0x7f8e4458a8d0>mock_configuration=<shared.config.ConfigHelperobjectat0x7f8e446d99c0>dbsession=<sqlalchemy.orm.session.Sessionobjectat0x7f8e3ff9fd40>mock_storage=<shared.storage.memory.MemoryStorageServiceobjectat0x7f8e45813290>celery_app=<Celerycelery.testsat0x7f8e458e2d50>@pytest.mark.django_db(databases={"default"}, transaction=True)deftest_upload_task_upload_processing_delay_upload_is_none(
self,
mocker,
mock_configuration,
dbsession,
mock_storage,
celery_app,
):
mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}})
mocker.patch.object(UploadTask, "app", celery_app)
mocker.patch(
"tasks.upload.possibly_update_commit_from_provider_info", return_value=True
)
mocker.patch.object(UploadTask, "possibly_setup_webhooks", return_value=True)
mocked_chord=mocker.patch("tasks.upload.chord")
commit=CommitFactory.create(
parent_commit_id=None,
message="",
commitid="abf6d4df662c47e32460020ab14abf9303581429",
repository__owner__unencrypted_oauth_token="test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy",
repository__owner__username="ThiagoCodecov",
repository__yaml={"codecov": {"max_report_age": "1y ago"}},
repository__name="example-python",
pullid=1,
)
dbsession.add(commit)
dbsession.flush()
redis=get_redis_connection()
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part1", "url": "someurl1"}',
)
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part2", "url": "someurl2"}',
)
>result=UploadTask().run_impl(dbsession, commit.repoid, commit.commitid)
.../tests/unit/test_upload_task.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tasks/upload.py:353: inrun_implreturnself.run_impl_within_lock(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
tasks/upload.py:462: inrun_impl_within_lockcommit_yaml=fetch_commit_yaml_and_possibly_store(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
services/repository.py:568: infetch_commit_yaml_and_possibly_storecommit_yaml=async_to_sync(fetch_commit_yaml_from_provider)(
.../local/lib/python3.13....../site-packages/asgiref/sync.py:277: in__call__returncall_result.result()
.../local/lib/python3.13....../concurrent/futures/_base.py:449: inresultreturnself.__get_result()
.../local/lib/python3.13....../concurrent/futures/_base.py:401: in__get_resultraiseself._exception
.../local/lib/python3.13....../site-packages/asgiref/sync.py:353: inmain_wrapresult=awaitself.awaitable(*args, **kwargs)
.../local/lib/python3.13.../shared/helpers/cache.py:275: inwrappedresult=awaitfunc(*args, **kwargs)
services/yaml/fetcher.py:19: infetch_commit_yaml_from_provideryaml_content=awaitshared_fetch_current_yaml_from_provider_via_reference(
.../local/lib/python3.13.../shared/yaml/fetcher.py:14: infetch_current_yaml_from_provider_via_referencelocation=awaitdetermine_commit_yaml_location(ref, repository_service)
.../local/lib/python3.13.../shared/yaml/fetcher.py:58: indetermine_commit_yaml_locationtop_level_files=awaitrepository_service.list_top_level_files(ref)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1007: inlist_top_level_filesreturnawaitself.list_files(ref, dir_path="", token=None)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1020: inlist_filesresults=awaitself.api(
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self=<bitbucketslug=ThiagoCodecov/example-pythonownerid=61repoid=27>client=<httpx.AsyncClientobjectat0x7f8e455a2750>, version='2'method='get'path='.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/'json=False, body=None, token=Nonekwargs= {'data': None, 'headers': {'Accept': 'application/json', 'User-Agent': 'Default'}, 'json': None}
url='https://bitbucket.org/api/2.0.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/..._consumer_key=None&oauth_token=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy&oauth_signature=TLcJE5NVXXILc8DRIn5kDWUO3PE%3D'headers= {'Accept': 'application/json', 'User-Agent': 'Default'}
oauth_body=Nonetoken_to_use= {'entity_name': '61', 'key': 'test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy', 'secret': None, 'username': 'ThiagoCodecov'}
oauth_client=<Clientclient_key=None, client_secret=None, resource_owner_key=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy, resource_own... callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=None, nonce=None, timestamp=None>log_dict= {'bot': 'ThiagoCodecov', 'endpoint': '.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/', 'event': 'api', 'method': 'get', ...}
res=<Response [500InternalServerError]>asyncdefapi(
self, client, version, method, path, json=False, body=None, token=None, **kwargs
):
url="https://bitbucket.org/api/%s.0%s"% (version, path)
headers= {
"Accept": "application/json",
"User-Agent": os.getenv("USER_AGENT", "Default"),
}
oauth_body=Noneurl=url_concat(url, kwargs)
ifjson:
headers["Content-Type"] ="application/json"elifbodyisnotNone:
headers["Content-Type"] ="application/x-www-form-urlencoded"oauth_body=bodytoken_to_use=tokenorself.tokenoauth_client=oauth1.Client(
self._oauth_consumer_token()["key"],
client_secret=self._oauth_consumer_token()["secret"],
resource_owner_key=token_to_use["key"],
resource_owner_secret=token_to_use["secret"],
signature_type=oauth1.SIGNATURE_TYPE_QUERY,
)
url, headers, oauth_body=oauth_client.sign(
url, http_method=method, body=oauth_body, headers=headers
)
kwargs=dict(
json=bodyifbodyisnotNoneandjsonelseNone,
data=oauth_bodyifnotjsonelseNone,
headers=headers,
)
log_dict=dict(
event="api",
endpoint=path,
method=method,
bot=token_to_use.get("username"),
repo_slug=self.slug,
)
try:
res=awaitclient.request(method.upper(), url, **kwargs)
logged_body=Noneifres.status_code>=300andres.textisnotNone:
logged_body=res.textlog.log(
logging.WARNINGifres.status_code>=300elselogging.INFO,
"Bitbucket HTTP %s",
res.status_code,
extra=dict(body=logged_body, **log_dict),
)
except (httpx.NetworkError, httpx.TimeoutException):
raiseTorngitServerUnreachableError("Bitbucket was not able to be reached.")
ifres.status_code==599:
raiseTorngitServerUnreachableError(
"Bitbucket was not able to be reached, server timed out."
)
elifres.status_code>=500:
>raiseTorngitServer5xxCodeError("Bitbucket is having 5xx issues")
Eshared.torngit.exceptions.TorngitServer5xxCodeError: Bitbucketishaving5xxissues
.../local/lib/python3.13.../shared/torngit/bitbucket.py:109: TorngitServer5xxCodeError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-staging

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completedFailedPassedSkipped
1788117874
View the top 1 failed tests by shortest run time
tasks/tests/unit/test_upload_task.py::TestUploadTaskIntegration::test_upload_task_upload_processing_delay_upload_is_none
Stack Traces | 46.9s run time
self=<worker.tasks.tests.unit.test_upload_task.TestUploadTaskIntegrationobjectat0x7f8e47028050>mocker=<pytest_mock.plugin.MockFixtureobjectat0x7f8e4458a8d0>mock_configuration=<shared.config.ConfigHelperobjectat0x7f8e446d99c0>dbsession=<sqlalchemy.orm.session.Sessionobjectat0x7f8e3ff9fd40>mock_storage=<shared.storage.memory.MemoryStorageServiceobjectat0x7f8e45813290>celery_app=<Celerycelery.testsat0x7f8e458e2d50>@pytest.mark.django_db(databases={"default"}, transaction=True)deftest_upload_task_upload_processing_delay_upload_is_none(
self,
mocker,
mock_configuration,
dbsession,
mock_storage,
celery_app,
):
mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}})
mocker.patch.object(UploadTask, "app", celery_app)
mocker.patch(
"tasks.upload.possibly_update_commit_from_provider_info", return_value=True
)
mocker.patch.object(UploadTask, "possibly_setup_webhooks", return_value=True)
mocked_chord=mocker.patch("tasks.upload.chord")
commit=CommitFactory.create(
parent_commit_id=None,
message="",
commitid="abf6d4df662c47e32460020ab14abf9303581429",
repository__owner__unencrypted_oauth_token="test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy",
repository__owner__username="ThiagoCodecov",
repository__yaml={"codecov": {"max_report_age": "1y ago"}},
repository__name="example-python",
pullid=1,
)
dbsession.add(commit)
dbsession.flush()
redis=get_redis_connection()
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part1", "url": "someurl1"}',
)
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part2", "url": "someurl2"}',
)
>result=UploadTask().run_impl(dbsession, commit.repoid, commit.commitid)
.../tests/unit/test_upload_task.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tasks/upload.py:353: inrun_implreturnself.run_impl_within_lock(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
tasks/upload.py:462: inrun_impl_within_lockcommit_yaml=fetch_commit_yaml_and_possibly_store(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
services/repository.py:568: infetch_commit_yaml_and_possibly_storecommit_yaml=async_to_sync(fetch_commit_yaml_from_provider)(
.../local/lib/python3.13....../site-packages/asgiref/sync.py:277: in__call__returncall_result.result()
.../local/lib/python3.13....../concurrent/futures/_base.py:449: inresultreturnself.__get_result()
.../local/lib/python3.13....../concurrent/futures/_base.py:401: in__get_resultraiseself._exception
.../local/lib/python3.13....../site-packages/asgiref/sync.py:353: inmain_wrapresult=awaitself.awaitable(*args, **kwargs)
.../local/lib/python3.13.../shared/helpers/cache.py:275: inwrappedresult=awaitfunc(*args, **kwargs)
services/yaml/fetcher.py:19: infetch_commit_yaml_from_provideryaml_content=awaitshared_fetch_current_yaml_from_provider_via_reference(
.../local/lib/python3.13.../shared/yaml/fetcher.py:14: infetch_current_yaml_from_provider_via_referencelocation=awaitdetermine_commit_yaml_location(ref, repository_service)
.../local/lib/python3.13.../shared/yaml/fetcher.py:58: indetermine_commit_yaml_locationtop_level_files=awaitrepository_service.list_top_level_files(ref)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1007: inlist_top_level_filesreturnawaitself.list_files(ref, dir_path="", token=None)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1020: inlist_filesresults=awaitself.api(
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self=<bitbucketslug=ThiagoCodecov/example-pythonownerid=61repoid=27>client=<httpx.AsyncClientobjectat0x7f8e455a2750>, version='2'method='get'path='.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/'json=False, body=None, token=Nonekwargs= {'data': None, 'headers': {'Accept': 'application/json', 'User-Agent': 'Default'}, 'json': None}
url='https://bitbucket.org/api/2.0.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/..._consumer_key=None&oauth_token=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy&oauth_signature=TLcJE5NVXXILc8DRIn5kDWUO3PE%3D'headers= {'Accept': 'application/json', 'User-Agent': 'Default'}
oauth_body=Nonetoken_to_use= {'entity_name': '61', 'key': 'test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy', 'secret': None, 'username': 'ThiagoCodecov'}
oauth_client=<Clientclient_key=None, client_secret=None, resource_owner_key=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy, resource_own... callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=None, nonce=None, timestamp=None>log_dict= {'bot': 'ThiagoCodecov', 'endpoint': '.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/', 'event': 'api', 'method': 'get', ...}
res=<Response [500InternalServerError]>asyncdefapi(
self, client, version, method, path, json=False, body=None, token=None, **kwargs
):
url="https://bitbucket.org/api/%s.0%s"% (version, path)
headers= {
"Accept": "application/json",
"User-Agent": os.getenv("USER_AGENT", "Default"),
}
oauth_body=Noneurl=url_concat(url, kwargs)
ifjson:
headers["Content-Type"] ="application/json"elifbodyisnotNone:
headers["Content-Type"] ="application/x-www-form-urlencoded"oauth_body=bodytoken_to_use=tokenorself.tokenoauth_client=oauth1.Client(
self._oauth_consumer_token()["key"],
client_secret=self._oauth_consumer_token()["secret"],
resource_owner_key=token_to_use["key"],
resource_owner_secret=token_to_use["secret"],
signature_type=oauth1.SIGNATURE_TYPE_QUERY,
)
url, headers, oauth_body=oauth_client.sign(
url, http_method=method, body=oauth_body, headers=headers
)
kwargs=dict(
json=bodyifbodyisnotNoneandjsonelseNone,
data=oauth_bodyifnotjsonelseNone,
headers=headers,
)
log_dict=dict(
event="api",
endpoint=path,
method=method,
bot=token_to_use.get("username"),
repo_slug=self.slug,
)
try:
res=awaitclient.request(method.upper(), url, **kwargs)
logged_body=Noneifres.status_code>=300andres.textisnotNone:
logged_body=res.textlog.log(
logging.WARNINGifres.status_code>=300elselogging.INFO,
"Bitbucket HTTP %s",
res.status_code,
extra=dict(body=logged_body, **log_dict),
)
except (httpx.NetworkError, httpx.TimeoutException):
raiseTorngitServerUnreachableError("Bitbucket was not able to be reached.")
ifres.status_code==599:
raiseTorngitServerUnreachableError(
"Bitbucket was not able to be reached, server timed out."
)
elifres.status_code>=500:
>raiseTorngitServer5xxCodeError("Bitbucket is having 5xx issues")
Eshared.torngit.exceptions.TorngitServer5xxCodeError: Bitbucketishaving5xxissues
.../local/lib/python3.13.../shared/torngit/bitbucket.py:109: TorngitServer5xxCodeError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-qa

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completedFailedPassedSkipped
1788117874
View the top 1 failed tests by shortest run time
tasks/tests/unit/test_upload_task.py::TestUploadTaskIntegration::test_upload_task_upload_processing_delay_upload_is_none
Stack Traces | 46.9s run time
self=<worker.tasks.tests.unit.test_upload_task.TestUploadTaskIntegrationobjectat0x7f8e47028050>mocker=<pytest_mock.plugin.MockFixtureobjectat0x7f8e4458a8d0>mock_configuration=<shared.config.ConfigHelperobjectat0x7f8e446d99c0>dbsession=<sqlalchemy.orm.session.Sessionobjectat0x7f8e3ff9fd40>mock_storage=<shared.storage.memory.MemoryStorageServiceobjectat0x7f8e45813290>celery_app=<Celerycelery.testsat0x7f8e458e2d50>@pytest.mark.django_db(databases={"default"}, transaction=True)deftest_upload_task_upload_processing_delay_upload_is_none(
self,
mocker,
mock_configuration,
dbsession,
mock_storage,
celery_app,
):
mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}})
mocker.patch.object(UploadTask, "app", celery_app)
mocker.patch(
"tasks.upload.possibly_update_commit_from_provider_info", return_value=True
)
mocker.patch.object(UploadTask, "possibly_setup_webhooks", return_value=True)
mocked_chord=mocker.patch("tasks.upload.chord")
commit=CommitFactory.create(
parent_commit_id=None,
message="",
commitid="abf6d4df662c47e32460020ab14abf9303581429",
repository__owner__unencrypted_oauth_token="test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy",
repository__owner__username="ThiagoCodecov",
repository__yaml={"codecov": {"max_report_age": "1y ago"}},
repository__name="example-python",
pullid=1,
)
dbsession.add(commit)
dbsession.flush()
redis=get_redis_connection()
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part1", "url": "someurl1"}',
)
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part2", "url": "someurl2"}',
)
>result=UploadTask().run_impl(dbsession, commit.repoid, commit.commitid)
.../tests/unit/test_upload_task.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tasks/upload.py:353: inrun_implreturnself.run_impl_within_lock(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
tasks/upload.py:462: inrun_impl_within_lockcommit_yaml=fetch_commit_yaml_and_possibly_store(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
services/repository.py:568: infetch_commit_yaml_and_possibly_storecommit_yaml=async_to_sync(fetch_commit_yaml_from_provider)(
.../local/lib/python3.13....../site-packages/asgiref/sync.py:277: in__call__returncall_result.result()
.../local/lib/python3.13....../concurrent/futures/_base.py:449: inresultreturnself.__get_result()
.../local/lib/python3.13....../concurrent/futures/_base.py:401: in__get_resultraiseself._exception
.../local/lib/python3.13....../site-packages/asgiref/sync.py:353: inmain_wrapresult=awaitself.awaitable(*args, **kwargs)
.../local/lib/python3.13.../shared/helpers/cache.py:275: inwrappedresult=awaitfunc(*args, **kwargs)
services/yaml/fetcher.py:19: infetch_commit_yaml_from_provideryaml_content=awaitshared_fetch_current_yaml_from_provider_via_reference(
.../local/lib/python3.13.../shared/yaml/fetcher.py:14: infetch_current_yaml_from_provider_via_referencelocation=awaitdetermine_commit_yaml_location(ref, repository_service)
.../local/lib/python3.13.../shared/yaml/fetcher.py:58: indetermine_commit_yaml_locationtop_level_files=awaitrepository_service.list_top_level_files(ref)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1007: inlist_top_level_filesreturnawaitself.list_files(ref, dir_path="", token=None)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1020: inlist_filesresults=awaitself.api(
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self=<bitbucketslug=ThiagoCodecov/example-pythonownerid=61repoid=27>client=<httpx.AsyncClientobjectat0x7f8e455a2750>, version='2'method='get'path='.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/'json=False, body=None, token=Nonekwargs= {'data': None, 'headers': {'Accept': 'application/json', 'User-Agent': 'Default'}, 'json': None}
url='https://bitbucket.org/api/2.0.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/..._consumer_key=None&oauth_token=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy&oauth_signature=TLcJE5NVXXILc8DRIn5kDWUO3PE%3D'headers= {'Accept': 'application/json', 'User-Agent': 'Default'}
oauth_body=Nonetoken_to_use= {'entity_name': '61', 'key': 'test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy', 'secret': None, 'username': 'ThiagoCodecov'}
oauth_client=<Clientclient_key=None, client_secret=None, resource_owner_key=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy, resource_own... callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=None, nonce=None, timestamp=None>log_dict= {'bot': 'ThiagoCodecov', 'endpoint': '.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/', 'event': 'api', 'method': 'get', ...}
res=<Response [500InternalServerError]>asyncdefapi(
self, client, version, method, path, json=False, body=None, token=None, **kwargs
):
url="https://bitbucket.org/api/%s.0%s"% (version, path)
headers= {
"Accept": "application/json",
"User-Agent": os.getenv("USER_AGENT", "Default"),
}
oauth_body=Noneurl=url_concat(url, kwargs)
ifjson:
headers["Content-Type"] ="application/json"elifbodyisnotNone:
headers["Content-Type"] ="application/x-www-form-urlencoded"oauth_body=bodytoken_to_use=tokenorself.tokenoauth_client=oauth1.Client(
self._oauth_consumer_token()["key"],
client_secret=self._oauth_consumer_token()["secret"],
resource_owner_key=token_to_use["key"],
resource_owner_secret=token_to_use["secret"],
signature_type=oauth1.SIGNATURE_TYPE_QUERY,
)
url, headers, oauth_body=oauth_client.sign(
url, http_method=method, body=oauth_body, headers=headers
)
kwargs=dict(
json=bodyifbodyisnotNoneandjsonelseNone,
data=oauth_bodyifnotjsonelseNone,
headers=headers,
)
log_dict=dict(
event="api",
endpoint=path,
method=method,
bot=token_to_use.get("username"),
repo_slug=self.slug,
)
try:
res=awaitclient.request(method.upper(), url, **kwargs)
logged_body=Noneifres.status_code>=300andres.textisnotNone:
logged_body=res.textlog.log(
logging.WARNINGifres.status_code>=300elselogging.INFO,
"Bitbucket HTTP %s",
res.status_code,
extra=dict(body=logged_body, **log_dict),
)
except (httpx.NetworkError, httpx.TimeoutException):
raiseTorngitServerUnreachableError("Bitbucket was not able to be reached.")
ifres.status_code==599:
raiseTorngitServerUnreachableError(
"Bitbucket was not able to be reached, server timed out."
)
elifres.status_code>=500:
>raiseTorngitServer5xxCodeError("Bitbucket is having 5xx issues")
Eshared.torngit.exceptions.TorngitServer5xxCodeError: Bitbucketishaving5xxissues
.../local/lib/python3.13.../shared/torngit/bitbucket.py:109: TorngitServer5xxCodeError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-public-qa

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completedFailedPassedSkipped
1788117874
View the top 1 failed tests by shortest run time
tasks/tests/unit/test_upload_task.py::TestUploadTaskIntegration::test_upload_task_upload_processing_delay_upload_is_none
Stack Traces | 46.9s run time
self=<worker.tasks.tests.unit.test_upload_task.TestUploadTaskIntegrationobjectat0x7f8e47028050>mocker=<pytest_mock.plugin.MockFixtureobjectat0x7f8e4458a8d0>mock_configuration=<shared.config.ConfigHelperobjectat0x7f8e446d99c0>dbsession=<sqlalchemy.orm.session.Sessionobjectat0x7f8e3ff9fd40>mock_storage=<shared.storage.memory.MemoryStorageServiceobjectat0x7f8e45813290>celery_app=<Celerycelery.testsat0x7f8e458e2d50>@pytest.mark.django_db(databases={"default"}, transaction=True)deftest_upload_task_upload_processing_delay_upload_is_none(
self,
mocker,
mock_configuration,
dbsession,
mock_storage,
celery_app,
):
mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}})
mocker.patch.object(UploadTask, "app", celery_app)
mocker.patch(
"tasks.upload.possibly_update_commit_from_provider_info", return_value=True
)
mocker.patch.object(UploadTask, "possibly_setup_webhooks", return_value=True)
mocked_chord=mocker.patch("tasks.upload.chord")
commit=CommitFactory.create(
parent_commit_id=None,
message="",
commitid="abf6d4df662c47e32460020ab14abf9303581429",
repository__owner__unencrypted_oauth_token="test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy",
repository__owner__username="ThiagoCodecov",
repository__yaml={"codecov": {"max_report_age": "1y ago"}},
repository__name="example-python",
pullid=1,
)
dbsession.add(commit)
dbsession.flush()
redis=get_redis_connection()
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part1", "url": "someurl1"}',
)
redis.lpush(
f"uploads/{commit.repoid}/{commit.commitid}",
'{"build": "part2", "url": "someurl2"}',
)
>result=UploadTask().run_impl(dbsession, commit.repoid, commit.commitid)
.../tests/unit/test_upload_task.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tasks/upload.py:353: inrun_implreturnself.run_impl_within_lock(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
tasks/upload.py:462: inrun_impl_within_lockcommit_yaml=fetch_commit_yaml_and_possibly_store(
.../local/lib/python3.13....../site-packages/sentry_sdk/tracing_utils.py:673: infunc_with_tracingreturnfunc(*args, **kwargs)
services/repository.py:568: infetch_commit_yaml_and_possibly_storecommit_yaml=async_to_sync(fetch_commit_yaml_from_provider)(
.../local/lib/python3.13....../site-packages/asgiref/sync.py:277: in__call__returncall_result.result()
.../local/lib/python3.13....../concurrent/futures/_base.py:449: inresultreturnself.__get_result()
.../local/lib/python3.13....../concurrent/futures/_base.py:401: in__get_resultraiseself._exception
.../local/lib/python3.13....../site-packages/asgiref/sync.py:353: inmain_wrapresult=awaitself.awaitable(*args, **kwargs)
.../local/lib/python3.13.../shared/helpers/cache.py:275: inwrappedresult=awaitfunc(*args, **kwargs)
services/yaml/fetcher.py:19: infetch_commit_yaml_from_provideryaml_content=awaitshared_fetch_current_yaml_from_provider_via_reference(
.../local/lib/python3.13.../shared/yaml/fetcher.py:14: infetch_current_yaml_from_provider_via_referencelocation=awaitdetermine_commit_yaml_location(ref, repository_service)
.../local/lib/python3.13.../shared/yaml/fetcher.py:58: indetermine_commit_yaml_locationtop_level_files=awaitrepository_service.list_top_level_files(ref)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1007: inlist_top_level_filesreturnawaitself.list_files(ref, dir_path="", token=None)
.../local/lib/python3.13.../shared/torngit/bitbucket.py:1020: inlist_filesresults=awaitself.api(
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self=<bitbucketslug=ThiagoCodecov/example-pythonownerid=61repoid=27>client=<httpx.AsyncClientobjectat0x7f8e455a2750>, version='2'method='get'path='.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/'json=False, body=None, token=Nonekwargs= {'data': None, 'headers': {'Accept': 'application/json', 'User-Agent': 'Default'}, 'json': None}
url='https://bitbucket.org/api/2.0.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/..._consumer_key=None&oauth_token=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy&oauth_signature=TLcJE5NVXXILc8DRIn5kDWUO3PE%3D'headers= {'Accept': 'application/json', 'User-Agent': 'Default'}
oauth_body=Nonetoken_to_use= {'entity_name': '61', 'key': 'test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy', 'secret': None, 'username': 'ThiagoCodecov'}
oauth_client=<Clientclient_key=None, client_secret=None, resource_owner_key=test7lk5ndmtqzxlx06rip65nac9c7epqopclnoy, resource_own... callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=None, nonce=None, timestamp=None>log_dict= {'bot': 'ThiagoCodecov', 'endpoint': '.../example-python/src/abf6d4df662c47e32460020ab14abf9303581429/', 'event': 'api', 'method': 'get', ...}
res=<Response [500InternalServerError]>asyncdefapi(
self, client, version, method, path, json=False, body=None, token=None, **kwargs
):
url="https://bitbucket.org/api/%s.0%s"% (version, path)
headers= {
"Accept": "application/json",
"User-Agent": os.getenv("USER_AGENT", "Default"),
}
oauth_body=Noneurl=url_concat(url, kwargs)
ifjson:
headers["Content-Type"] ="application/json"elifbodyisnotNone:
headers["Content-Type"] ="application/x-www-form-urlencoded"oauth_body=bodytoken_to_use=tokenorself.tokenoauth_client=oauth1.Client(
self._oauth_consumer_token()["key"],
client_secret=self._oauth_consumer_token()["secret"],
resource_owner_key=token_to_use["key"],
resource_owner_secret=token_to_use["secret"],
signature_type=oauth1.SIGNATURE_TYPE_QUERY,
)
url, headers, oauth_body=oauth_client.sign(
url, http_method=method, body=oauth_body, headers=headers
)
kwargs=dict(
json=bodyifbodyisnotNoneandjsonelseNone,
data=oauth_bodyifnotjsonelseNone,
headers=headers,
)
log_dict=dict(
event="api",
endpoint=path,
method=method,
bot=token_to_use.get("username"),
repo_slug=self.slug,
)
try:
res=awaitclient.request(method.upper(), url, **kwargs)
logged_body=Noneifres.status_code>=300andres.textisnotNone:
logged_body=res.textlog.log(
logging.WARNINGifres.status_code>=300elselogging.INFO,
"Bitbucket HTTP %s",
res.status_code,
extra=dict(body=logged_body, **log_dict),
)
except (httpx.NetworkError, httpx.TimeoutException):
raiseTorngitServerUnreachableError("Bitbucket was not able to be reached.")
ifres.status_code==599:
raiseTorngitServerUnreachableError(
"Bitbucket was not able to be reached, server timed out."
)
elifres.status_code>=500:
>raiseTorngitServer5xxCodeError("Bitbucket is having 5xx issues")
Eshared.torngit.exceptions.TorngitServer5xxCodeError: Bitbucketishaving5xxissues
.../local/lib/python3.13.../shared/torngit/bitbucket.py:109: TorngitServer5xxCodeError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@tnt-sentry@drazisil-codecov