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: Isolated Build Agent Integration Tests #10460

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_BUILDAGENT;
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE;
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_LOCALCI;
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_TEST_BUILDAGENT;

import java.net.UnknownHostException;
import java.nio.file.Path;
Expand Down Expand Up @@ -261,7 +262,7 @@ public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties
}

// build agents should not hold partitions and only be a lite member
if (!activeProfiles.contains(PROFILE_CORE) && activeProfiles.contains(PROFILE_BUILDAGENT)) {
if (!activeProfiles.contains(PROFILE_TEST_BUILDAGENT) && !activeProfiles.contains(PROFILE_CORE) && activeProfiles.contains(PROFILE_BUILDAGENT)) {
log.info("Joining cluster as lite member");
config.setLiteMember(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ public final class Constants {
*/
public static final String PROFILE_BUILDAGENT = "buildagent";

public static final String PROFILE_TEST_BUILDAGENT = "buildagent-test";

/**
* The name of the Spring profile used to process build jobs in a Jenkins setup.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package de.tum.cit.aet.artemis.assessment.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.assessment.domain.Complaint;
Expand All @@ -22,6 +25,7 @@
* Service responsible for initializing the database with specific testdata related to complaints for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class ComplaintUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.cit.aet.artemis.assessment.util;

import static org.assertj.core.api.Assertions.fail;
import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand All @@ -16,6 +17,7 @@
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;

Expand All @@ -30,6 +32,7 @@
* Service responsible for initializing the database with specific testdata related to grading for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class GradingScaleUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package de.tum.cit.aet.artemis.assessment.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.assessment.domain.Result;
Expand All @@ -13,6 +16,7 @@
* Service responsible for initializing the database with specific testdata related to student scores for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class StudentScoreUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package de.tum.cit.aet.artemis.atlas.competency.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.competency.CompetencyProgress;
Expand All @@ -12,6 +15,7 @@
* Service responsible for initializing the database with specific testdata related to competency progress for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class CompetencyProgressUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package de.tum.cit.aet.artemis.atlas.competency.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.time.ZonedDateTime;

import jakarta.validation.constraints.NotNull;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.competency.Competency;
Expand All @@ -28,6 +31,7 @@
* Service responsible for initializing the database with specific test data related to competencies for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class CompetencyUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package de.tum.cit.aet.artemis.atlas.competency.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.competency.Prerequisite;
Expand All @@ -14,6 +17,7 @@
* Service responsible for initializing the database with specific test data related to prerequisites for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class PrerequisiteUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package de.tum.cit.aet.artemis.atlas.competency.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.util.ArrayList;
import java.util.stream.Stream;

import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.competency.CompetencyTaxonomy;
Expand All @@ -19,6 +22,7 @@
import de.tum.cit.aet.artemis.atlas.repository.StandardizedCompetencyRepository;

@Service
@Profile(SPRING_PROFILE_TEST)
public class StandardizedCompetencyUtilService {

public static final long ID_NOT_EXISTS = -1000L;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package de.tum.cit.aet.artemis.atlas.learningpath.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.service.learningpath.LearningPathService;
Expand All @@ -13,6 +16,7 @@
* Service responsible for initializing the database with specific testdata related to learning paths for use in integration tests.
*/
@Service
@Profile(SPRING_PROFILE_TEST)
public class LearningPathUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package de.tum.cit.aet.artemis.atlas.profile.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.util.Set;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.profile.LearnerProfile;
import de.tum.cit.aet.artemis.core.domain.User;
import de.tum.cit.aet.artemis.core.test_repository.UserTestRepository;

@Service
@Profile(SPRING_PROFILE_TEST)
public class LearnerProfileUtilService {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package de.tum.cit.aet.artemis.atlas.science.util;

import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST;

import java.time.Duration;
import java.time.ZonedDateTime;
import java.util.Comparator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import de.tum.cit.aet.artemis.atlas.domain.science.ScienceEvent;
import de.tum.cit.aet.artemis.atlas.domain.science.ScienceEventType;
import de.tum.cit.aet.artemis.atlas.test_repository.ScienceEventTestRepository;

@Service
@Profile(SPRING_PROFILE_TEST)
public class ScienceUtilService {

@Autowired
Expand Down
Loading
Loading