From dfe461c601842f8dfe190b12446f2d6f1d2739d2 Mon Sep 17 00:00:00 2001 From: Florian Gareis Date: Thu, 14 Sep 2023 11:55:12 +0200 Subject: [PATCH 1/2] Development: Remove --legacy-peer-deps and fix postgres file link (#7198) --- docker/artemis-migration-check-postgres.yml | 4 ++-- docker/cypress-E2E-tests-mysql.yml | 2 +- docker/cypress-E2E-tests-postgres.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/artemis-migration-check-postgres.yml b/docker/artemis-migration-check-postgres.yml index 0d801be844d2..5f7cf661c39f 100644 --- a/docker/artemis-migration-check-postgres.yml +++ b/docker/artemis-migration-check-postgres.yml @@ -17,8 +17,8 @@ services: condition: service_healthy postgresql: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres migration-check: image: alpine container_name: migration-check diff --git a/docker/cypress-E2E-tests-mysql.yml b/docker/cypress-E2E-tests-mysql.yml index 96f9fe67989f..99e96f8b7c87 100644 --- a/docker/cypress-E2E-tests-mysql.yml +++ b/docker/cypress-E2E-tests-mysql.yml @@ -45,7 +45,7 @@ services: environment: CYPRESS_DB_TYPE: "MySQL" SORRY_CYPRESS_PROJECT_ID: "artemis-mysql" - command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci --legacy-peer-deps && npm run cypress:setup && (npm run cypress:record:mysql & sleep 60 && npm run cypress:record:mysql & wait)" + command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:mysql & sleep 60 && npm run cypress:record:mysql & wait)" networks: artemis: diff --git a/docker/cypress-E2E-tests-postgres.yml b/docker/cypress-E2E-tests-postgres.yml index a42d2232adc7..0c2ed641ee70 100644 --- a/docker/cypress-E2E-tests-postgres.yml +++ b/docker/cypress-E2E-tests-postgres.yml @@ -46,7 +46,7 @@ services: environment: CYPRESS_DB_TYPE: "Postgres" SORRY_CYPRESS_PROJECT_ID: "artemis-postgres" - command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci --legacy-peer-deps && npm run cypress:setup && (npm run cypress:record:postgres & sleep 60 && npm run cypress:record:postgres & wait)" + command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:postgres & sleep 60 && npm run cypress:record:postgres & wait)" networks: artemis: From 9e3eabd759fd25bbef194c8689974ead255feb16 Mon Sep 17 00:00:00 2001 From: lara Date: Thu, 14 Sep 2023 19:37:14 +0200 Subject: [PATCH 2/2] fix DatabaseQueryCountTest --- .../tum/in/www1/artemis/DatabaseQueryCountTest.java | 5 +++++ .../ProgrammingSubmissionIntegrationTest.java | 12 ++---------- .../behavioral/BehavioralTestCaseServiceTest.java | 2 -- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java index 639a7975620f..403e9e1a1114 100644 --- a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java +++ b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java @@ -1,5 +1,7 @@ package de.tum.in.www1.artemis; +import java.util.Set; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.Logger; @@ -10,6 +12,7 @@ import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; +import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.exam.StudentExam; import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; @@ -35,6 +38,8 @@ class DatabaseQueryCountTest extends AbstractSpringIntegrationTest { void setup() { participantScoreScheduleService.shutdown(); userUtilService.addUsers(TEST_PREFIX, 1, NUMBER_OF_TUTORS, 0, 0); + User student = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); + student.setGroups(Set.of(TEST_PREFIX + "tumuser")); } @Test diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java index 1b4c28d7cefa..f4aad7eb54c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; @@ -34,19 +33,13 @@ import de.tum.in.www1.artemis.domain.enumeration.SubmissionType; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; import de.tum.in.www1.artemis.domain.modeling.ModelingSubmission; -import de.tum.in.www1.artemis.domain.participation.Participation; -import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation; -import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; -import de.tum.in.www1.artemis.domain.participation.StudentParticipation; +import de.tum.in.www1.artemis.domain.participation.*; import de.tum.in.www1.artemis.exception.ContinuousIntegrationException; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.modelingexercise.ModelingExerciseUtilService; import de.tum.in.www1.artemis.participation.ParticipationFactory; import de.tum.in.www1.artemis.participation.ParticipationUtilService; -import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; -import de.tum.in.www1.artemis.repository.ProgrammingExerciseStudentParticipationRepository; -import de.tum.in.www1.artemis.repository.ProgrammingSubmissionRepository; -import de.tum.in.www1.artemis.repository.StudentParticipationRepository; +import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.service.connectors.bamboo.dto.BambooBuildPlanDTO; import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; @@ -230,7 +223,6 @@ void triggerBuildStudentForbidden() throws Exception { } @Test - @Timeout(5) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void triggerBuildForExerciseAsInstructor() throws Exception { bambooRequestMockProvider.enableMockingOfRequests(); diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java index e0f94c1d7eb7..fcd475bebb72 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; @@ -144,7 +143,6 @@ private TestwiseCoverageReportEntry newCoverageReportEntry(int startLine, int li } @Test - @Timeout(1000) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void testGenerationForSimpleExample() throws Exception { exercise = hestiaUtilTestService.setupSolution("Test.java", "A\nB\nC\nD\nE\nF\nG\nH", exercise, solutionRepo);