Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-codecov committed Nov 21, 2024
2 parents 6c817e9 + 70ec67f commit f389fba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions upload/tests/views/test_upload_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_deactivated_repo(db):
)
client = APIClient()
client.credentials(HTTP_AUTHORIZATION="token " + repository.upload_token)
response = client.post(url, {"commit_sha": "abc123"}, format="json")
response = client.post(url, {"commitid": "abc123"}, format="json")
assert response.status_code == 400
assert "This repository is deactivated" in str(response.json())

Expand All @@ -91,7 +91,7 @@ def test_upload_coverage_with_errors(db):

# Invalid flag format
response = client.post(
url, {"commit_sha": "abc123", "flags": "not-a-list"}, format="json"
url, {"commitid": "abc123", "flags": "not-a-list"}, format="json"
)
assert response.status_code == 400
assert "flags" in response.json()
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_upload_coverage_post(db, mocker):
"ci_service": "ci_service",
"ci_url": "ci_url",
"code": "code",
"commit_sha": commit.commitid,
"commitid": commit.commitid,
"flags": ["flag1", "flag2"],
"job_code": "job_code",
"version": "version",
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_upload_coverage_post_shelter(db, mocker):
"ci_service": "ci_service",
"ci_url": "ci_url",
"code": "code",
"commit_sha": commit.commitid,
"commitid": commit.commitid,
"flags": ["flag1", "flag2"],
"job_code": "job_code",
"storage_path": "shelter/test/path.txt",
Expand Down
12 changes: 6 additions & 6 deletions upload/views/upload_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def post(self, request: HttpRequest, *args, **kwargs) -> Response:

# Create commit
create_commit_data = dict(
commitid=request.data.get("commit_sha"),
parent_commit_id=request.data.get("parent_sha"),
pullid=request.data.get("pull_request_number"),
branch=request.data.get("branch"),
commitid=request.data.get("commitid"),
parent_commit_id=request.data.get("parent_commit_id"),
pullid=request.data.get("pullid"),
)
commit_serializer = CommitSerializer(data=create_commit_data)
if not commit_serializer.is_valid():
Expand Down Expand Up @@ -107,10 +107,10 @@ def post(self, request: HttpRequest, *args, **kwargs) -> Response:

# Do upload
upload_data = dict(
ci_url=request.data.get("build_url"),
env=request.data.get("env_vars"),
flags=request.data.get("flags"),
ci_service=request.data.get("ci_service"),
ci_url=request.data.get("ci_url"),
env=request.data.get("env"),
flags=request.data.get("flags"),
job_code=request.data.get("job_code"),
name=request.data.get("name"),
version=request.data.get("version"),
Expand Down

0 comments on commit f389fba

Please sign in to comment.