-
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
Development
: Refactor ExamIntegrationTest
#7112
Conversation
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.
Test changes look mostly good to me. Left one small suggestion ^^
src/test/java/de/tum/in/www1/artemis/exam/ExamParticipationIntegrationTest.java
Outdated
Show resolved
Hide resolved
…tionTest' into development/refactor-ExamIntegrationTest
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.
Changes LGTM. Tests succeed on bamboo and GitHub Actions 👍
The number of tests on bamboo did not change, indicating that no test was lost
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.
Changes look good in general 👍 Left some small comments/suggestions:
- Shouldn't it be moved to
ExamRegistrationIntegrationTest
?Artemis/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java
Lines 755 to 760 in 69cb7cd
@Test @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void testDeleteStudentThatDoesNotExist() throws Exception { Exam exam = examUtilService.setupExamWithExerciseGroupsExercisesRegisteredStudents(TEST_PREFIX, course1, 1); request.delete("/api/courses/" + course1.getId() + "/exams/" + exam.getId() + "/students/nonExistingStudent", HttpStatus.NOT_FOUND); }
src/test/java/de/tum/in/www1/artemis/exam/ExamParticipationIntegrationTest.java
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/ProgrammingExamIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/TestExamIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/TestExamIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/in/www1/artemis/exam/ExamParticipationIntegrationTest.java
Outdated
Show resolved
Hide resolved
…tionTest' into development/refactor-ExamIntegrationTest
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 looks good. Thanks for the changes 👍
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 👍
Checklist
General
Server
Motivation and Context
The class
ExamIntegrationTest
has over 3000 lines of code and around 150 tests and can be considered to be a blob. This antipattern also causes the integration test to be slow, since many attributes (sometimes only used in a few tests) to be initialized and the setup is expensive. In this PR I moved some of the tests, previously found in `ExamIntegrationTest to new and already existing integration tests.Description
The following new classes were created:
ExamRegistrationIntegrationTest
: student registration for exams, and removing students from examsExamParticipationIntegrationTest
: testing related to participationTestExamIntegrationTest
: handels test exam related testsProgrammingExamIntegrationTest
: Houses tests directly linked to pro- gramming exercises incorporated within exams.ExamStartTest
: Testing exam exercise start for different types of exercises.Tests which fit into one of these classes have been moved, in
ExamIntegrationTest
remain exam creation, access, importing and other tests.Review Progress
Code Review
Test Coverage
unchanged