Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development/enable-parallel-unit…
Browse files Browse the repository at this point in the history
…-testing' into development/enable-parallel-unit-testing
  • Loading branch information
DominikRemo committed Sep 14, 2023
2 parents 2cc4f99 + 9e3eabd commit 6824f44
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docker/artemis-migration-check-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/cypress-E2E-tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docker/cypress-E2E-tests-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.*;

Check warning on line 36 in src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java

View check run for this annotation

Teamscale / teamscale-findings

src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java#L36

Star import of `de.tum.in.www1.artemis.domain.participation.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=development%2Fenable-parallel-unit-testing%3AHEAD&id=FACB57788AA08369E3479FEE2EA4EC5E
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.*;

Check warning on line 42 in src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java

View check run for this annotation

Teamscale / teamscale-findings

src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java#L42

Star import of `de.tum.in.www1.artemis.repository.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=development%2Fenable-parallel-unit-testing%3AHEAD&id=7BC47177C2C47FBA1D23BBB7666BB859
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;
Expand Down Expand Up @@ -230,7 +223,6 @@ void triggerBuildStudentForbidden() throws Exception {
}

@Test
@Timeout(5)
@WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR")
void triggerBuildForExerciseAsInstructor() throws Exception {
bambooRequestMockProvider.enableMockingOfRequests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6824f44

Please sign in to comment.