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

Development: Refactor ExamIntegrationTest #7112

Merged
merged 18 commits into from
Sep 15, 2023

Conversation

laadvo
Copy link
Contributor

@laadvo laadvo commented Aug 29, 2023

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 exams
  • ExamParticipationIntegrationTest: testing related to participation
  • TestExamIntegrationTest: handels test exam related tests
  • ProgrammingExamIntegrationTest: 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

  • Code Review 1
  • Code Review 2

Test Coverage

unchanged

@laadvo laadvo marked this pull request as ready for review August 31, 2023 08:23
@laadvo laadvo requested a review from a team as a code owner August 31, 2023 08:23
Copy link
Contributor

@DominikRemo DominikRemo left a 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 ^^

@laadvo laadvo requested a review from DominikRemo September 4, 2023 21:21
DominikRemo
DominikRemo previously approved these changes Sep 4, 2023
Copy link
Contributor

@DominikRemo DominikRemo left a 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

DominikRemo
DominikRemo previously approved these changes Sep 7, 2023
Copy link
Contributor

@terlan98 terlan98 left a 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?
    @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);
    }

Copy link
Contributor

@terlan98 terlan98 left a 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 👍

Copy link
Contributor

@DominikRemo DominikRemo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@laadvo laadvo added this to the 6.5.0 milestone Sep 14, 2023
@krusche krusche merged commit 8cf6704 into develop Sep 15, 2023
27 of 31 checks passed
@krusche krusche deleted the development/refactor-ExamIntegrationTest branch September 15, 2023 05:23
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.

4 participants