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

Add tests for empty payload consumer commit #834

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

matyaskuti
Copy link
Contributor

@matyaskuti matyaskuti commented Mar 6, 2024

About this change - What it does

Following up on #833, adding tests around the fix that was hastily implemented there.

@matyaskuti matyaskuti force-pushed the matyaskuti/consumer_empty_commit_test branch from 9211c5e to 2486768 Compare March 6, 2024 10:49
@matyaskuti matyaskuti changed the title Add test for empty payload consumer commit Add tests for empty payload consumer commit Mar 6, 2024
@matyaskuti matyaskuti force-pushed the matyaskuti/consumer_empty_commit_test branch from 2486768 to d00ab8a Compare March 6, 2024 11:55
@matyaskuti matyaskuti marked this pull request as ready for review March 6, 2024 12:16
@matyaskuti matyaskuti requested review from a team as code owners March 6, 2024 12:16
Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

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

Looks fine except for the trail that I feel it’s useless. It is?

topic_name = new_topic(admin_client)
offsets_path = f"/consumers/{group_name}/instances/{instance_id}/offsets{trail}"
assign_path = f"/consumers/{group_name}/instances/{instance_id}/assignments{trail}"
consume_path = f"/consumers/{group_name}/instances/{instance_id}/records{trail}?timeout=5000"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the optional trailing?

@@ -251,6 +251,80 @@ async def test_offsets(rest_async_client, admin_client, trail):
assert "partition" in data and data["partition"] == 0, f"Unexpected partition {data}"


@pytest.mark.parametrize("trail", ["", "/"])
Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot see the value of that parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've followed the pattern of the other tests here, which all have it. I sort of understand why that is there, with some frameworks this can go wrong fairly easy :(

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess what's odd is that we support both, but since we do, I guess it makes sense to test it.

Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

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

See you spaceboy 🔫

@eliax1996 eliax1996 merged commit cb6aa95 into main Mar 8, 2024
8 checks passed
@eliax1996 eliax1996 deleted the matyaskuti/consumer_empty_commit_test branch March 8, 2024 13:35
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