-
Notifications
You must be signed in to change notification settings - Fork 297
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
Exam mode
: Only send student notifications when end time has changed
#7382
Exam mode
: Only send student notifications when end time has changed
#7382
Conversation
Exam mode
: Only send notifications when end time has changed
TODO:
I'd skip the E2E's as it was a server issue, and rather do them in a separate PR. |
Exam mode
: Only send notifications when end time has changedExam mode
: Only send student notifications when end time has changed
Please add a comment why equals cannot be used here. |
There's already an explanation a few lines above. Imho, this is sufficient. Tell me if you think otherwise.
|
…en-updating-exam-details
Interesting thing: There is a test for the case, that a exam title is updated, without updating the dates, and no notification should be sent. However, this test just does not work, as the update data is not sent from the client, but uses the server-side dates. These dates of course match (i.e. However, if the data is coming from the client, the dates do not match w/ Here's the test: Artemis/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java Lines 423 to 427 in 8425924
|
if (!originalExam.getEndDate().equals(savedExam.getEndDate())) { | ||
if (comparator.compare(originalExam.getEndDate(), savedExam.getEndDate()) != 0) { |
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.
Note: this is the only change in this PR. The rest is adding & fixing tests
src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.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.
Note: In general, I've ripped some tests apart and created individual tests. This way, it is clearer what is tested, failing cases can be pinned down more easily, and when refactoring, only single test cases have to be touched. Please tell me if you explicitly want these aggregated test cases in Artemis, and this was a design decision.
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.
Looks good in general, thanks for taking the time to cleanup and improve the tests. Just a few small suggestions:
src/test/java/de/tum/in/www1/artemis/util/AbstractArtemisIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.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.
Works on ts1
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.
Tested in testing session
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.
Works as expected, tested on ts1
Checklist
General
Server
Motivation and Context
This PR fixes a bug introduced in #7284. When saving, the code comparing the new and old end date uses
equals
, which always returnsfalse
. This concern was already discussed about in the comments of the PR, however failed to address it properly, and the issue was not found in manual testing.Description
This PR now uses the comparator, comparing dates on seconds-precision.
Steps for Testing
Case 1: No date change - no notification
Prerequisites:
Case 2: Date change + notification
Prerequisites:
Review Progress
Performance Review
Code Review
Exam Mode Test
Test Coverage