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

tsdb/index: Refactor Reader tests #14071

Merged
merged 5 commits into from May 16, 2024

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented May 9, 2024

Refactor tsdb/index.Reader tests and a benchmark, as they have a lot in common. Pulled out of #13620, as the refactor became irrelevant there :)

I think the tests/benchmark become much more maintainable and easier to understand after this refactoring.

@aknuds1 aknuds1 requested a review from bboreham May 9, 2024 09:31
@aknuds1 aknuds1 requested a review from jesusvazquez as a code owner May 9, 2024 09:31
@aknuds1 aknuds1 force-pushed the arve/refactor-index-tests branch 2 times, most recently from d49e617 to 78491c5 Compare May 9, 2024 09:57
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 force-pushed the arve/refactor-index-tests branch from 78491c5 to 54a3d1d Compare May 9, 2024 12:39
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

LGTM. Just a comment style suggestion, and of course, merge conflicts…

tsdb/index/index_test.go Outdated Show resolved Hide resolved
aknuds1 and others added 3 commits May 15, 2024 20:25
…ex-tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 requested a review from beorn7 May 15, 2024 18:51
@aknuds1
Copy link
Contributor Author

aknuds1 commented May 15, 2024

Thanks for the review @beorn7 - I fixed the merge conflicts (and refactored TestReader_PostingsForLabelMatchingHonorsContextCancel to use createFileReader), and applied your suggestion. PTAL :)

…heus into arve/refactor-index-tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@beorn7
Copy link
Member

beorn7 commented May 16, 2024

Thank you, will merge now.

@beorn7 beorn7 merged commit 5ca56ee into prometheus:main May 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants