-
Notifications
You must be signed in to change notification settings - Fork 294
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
Development
: Fix issues with server test flakiness
#9417
Conversation
This reverts commit e47ac99.
Chore
: Improve test flakynessDevelopment
: Improve test flakyness
…lVCSshIntegrationTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java (7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java (1)
Pattern
src/test/java/**/*.java
: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java (7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java (1)
Pattern
src/test/java/**/*.java
: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/localvcci/LocalVCSshIntegrationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 Files selected for processing (6)
- src/test/java/de/tum/cit/aet/artemis/atlas/competency/CourseCompetencyIntegrationTest.java (0 hunks)
- src/test/java/de/tum/cit/aet/artemis/communication/notification/NotificationScheduleServiceTest.java (0 hunks)
- src/test/java/de/tum/cit/aet/artemis/communication/notification/SingleUserNotificationServiceTest.java (6 hunks)
- src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java (0 hunks)
- src/test/java/de/tum/cit/aet/artemis/communication/service/EmailSummaryServiceTest.java (0 hunks)
- src/test/java/de/tum/cit/aet/artemis/core/MetricsIntegrationTest.java (0 hunks)
💤 Files with no reviewable changes (5)
- src/test/java/de/tum/cit/aet/artemis/atlas/competency/CourseCompetencyIntegrationTest.java
- src/test/java/de/tum/cit/aet/artemis/communication/notification/NotificationScheduleServiceTest.java
- src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java
- src/test/java/de/tum/cit/aet/artemis/communication/service/EmailSummaryServiceTest.java
- src/test/java/de/tum/cit/aet/artemis/core/MetricsIntegrationTest.java
🧰 Additional context used
📓 Path-based instructions (1)
src/test/java/de/tum/cit/aet/artemis/communication/notification/SingleUserNotificationServiceTest.java (1)
Pattern
src/test/java/**/*.java
: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true
🔇 Additional comments (1)
src/test/java/de/tum/cit/aet/artemis/communication/notification/SingleUserNotificationServiceTest.java (1)
137-142
: Proper addition of@Captor
annotationsThe inclusion of
@Captor
annotations forappleNotificationCaptor
andfirebaseNotificationCaptor
correctly sets up argument captors for verifying notifications in the tests. This enhances the test's ability to assert that the correct notifications are being sent.
private List<SingleUserNotification> filterRelevantNotifications(List<Notification> notifications, String title, User recipient) { | ||
return notifications.stream().filter(notification -> notification instanceof SingleUserNotification).map(notification -> (SingleUserNotification) notification) | ||
.filter(notification -> title.equals(notification.getText()) && recipient.getId().equals(notification.getRecipient().getId())).toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Rename parameter title
to text
for clarity
In the filterRelevantNotifications
method, the parameter title
is compared with notification.getText()
. To avoid confusion between notification.getTitle()
and notification.getText()
, consider renaming the parameter to text
to accurately reflect its purpose.
Apply this diff to rename the parameter:
-private List<SingleUserNotification> filterRelevantNotifications(List<Notification> notifications, String title, User recipient) {
+private List<SingleUserNotification> filterRelevantNotifications(List<Notification> notifications, String text, User recipient) {
return notifications.stream()
- .filter(notification -> title.equals(notification.getText()) && recipient.getId().equals(notification.getRecipient().getId()))
+ .filter(notification -> text.equals(notification.getText()) && recipient.getId().equals(notification.getRecipient().getId()))
.toList();
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
private List<SingleUserNotification> filterRelevantNotifications(List<Notification> notifications, String title, User recipient) { | |
return notifications.stream().filter(notification -> notification instanceof SingleUserNotification).map(notification -> (SingleUserNotification) notification) | |
.filter(notification -> title.equals(notification.getText()) && recipient.getId().equals(notification.getRecipient().getId())).toList(); | |
private List<SingleUserNotification> filterRelevantNotifications(List<Notification> notifications, String text, User recipient) { | |
return notifications.stream().filter(notification -> notification instanceof SingleUserNotification).map(notification -> (SingleUserNotification) notification) | |
.filter(notification -> text.equals(notification.getText()) && recipient.getId().equals(notification.getRecipient().getId())).toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code
Development
: Improve test flakynessDevelopment
: Fix issues with server test flakiness
Integrated code lifecycle
: Provide Instructors more options to control container configuration
#9487
Motivation and Context
Some server tests are flaky after changing the test order by restructuring into modules.
Description
Following improvements:
mockito-verify
's not depend on an absolut stategc.log.lock
generated by JGit in each repository on zipping and deletionOut-of-scope
LocalVCLocalCIIntegrationTest
to fail (no matter of the order)Object#equals()
in each atlas entity/domain object to ensure thatMockito.verify
does not depend on the entity/domain object being in memory (and not "unproxied" or whatever might happen in the background)Summary by CodeRabbit
New Features
Bug Fixes
expirationDate
to ensure consistent behavior across date types.Tests
Chores