-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix UserResourceIT #25525
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 UserResourceIT #25525
Conversation
Code Review 👍 Approved with suggestions 0 resolved / 2 findingsSolid pagination improvements for flaky tests. Two minor issues from previous review remain: redundant assertTrue(true) and test cleanup concerns. 💡 Quality: Redundant assertTrue(true) assertion📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/UserResourceIT.java:165 The assertion Suggestion: Either remove this block entirely, or if you want to log a message when the expected pagination scenario occurs, use a logger or add a test comment. The conditional block itself provides no meaningful assertion: // Remove this entire block:
if (!foundInFirstPage && totalPagesSearched > 1) {
assertTrue(true, "User correctly found via pagination as expected");
}Or if you want to explicitly document the expected behavior in test output, consider using a logging statement or JUnit's 💡 Performance: Test creates 101 users without explicit cleanup📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/UserResourceIT.java:83 The new pagination boundary test creates 101 users in a loop (lines 83-92), but there's no cleanup of these users after the test completes. While the
Suggestion: Consider adding cleanup in a // Example: Track created users for cleanup
List<UUID> createdUserIds = new ArrayList<>();
for (int i = 0; i < usersToCreate; i++) {
User created = createEntity(createRequest);
createdUserIds.add(created.getId());
}
// ... in cleanup or finally block:
// createdUserIds.forEach(id -> deleteEntity(id.toString()));OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Describe your changes:
Fixes
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
test_listUsersWithAdminFilterinUserResourceIT.javawith pagination logic to search across all pagesfindUserInPaginatedResultshelper method to centralize pagination filteringtest_listUsersWithBotFilter,test_listUsersWithTeamFilter, andtest_listUsersWithDomainFilternow use centralized paginationtest_listUsersWithAdminFilter_paginationBoundarycreates 101 users to verify filter works across page boundariesThis will update automatically on new commits.