Skip to content

Commit

Permalink
Development: Remove testwise coverage support (#9993)
Browse files Browse the repository at this point in the history
  • Loading branch information
krusche authored Jan 4, 2025
1 parent 82bf67c commit 22d38a8
Show file tree
Hide file tree
Showing 408 changed files with 1,003 additions and 17,785 deletions.
1 change: 0 additions & 1 deletion .github/issue-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ programming:
- build plan
- code hint
- \b(?<!\S)git(?!\S)\b
- testwise coverage
- \b(?<!\S)ide(?!\S)\b
- submission policy
- aeolus
Expand Down
3 changes: 0 additions & 3 deletions docs/admin/setup/programming-exercises.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ server or exercise settings:
* - ``#isStaticCodeAnalysisEnabled``
- Defines if static code analysis should be performed.
- Exercise configuration
* - ``#isTestWiseCoverageEnabled``
- Defines if testwise coverage should be collected.
- Exercise configuration

The ``pipeline.groovy`` file can be customized further by instructors after creating the exercise from within
Artemis via the ‘Edit Build Plan’ button on the details page of the exercise.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 37 additions & 42 deletions docs/user/exercises/programming-exercise-features.inc

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/user/exercises/programming-exercise-setup.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ Generate programming exercise
- **Sequential Test Runs:** Activate this option to first run structural and then behavior tests.
This feature allows students to better concentrate on the immediate challenge at hand.
Not supported together with static code analysis. Cannot be changed after the exercise creation.
- **Record Testwise Coverage:** Activate this option to record the testwise coverage for the solution repository.
This is necessary when working with Hestia to generate code-based hints.
This option is only available for Java/Kotlin-exercises with non-sequential test runs.
- **Customize Build Plan** Activate this option if you want to customize the build plan of your exercise.
This feature is available for all programming languages, and works with LocalCI and Jenkins, Artemis provides templates for the build plan configuration.
The build plan can also be customized after the exercise creation.
Expand Down
4 changes: 2 additions & 2 deletions gradle/test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ jacocoTestCoverageVerification {
counter = "INSTRUCTION"
value = "COVEREDRATIO"
// TODO: in the future the following value should become higher than 0.92
minimum = 0.895
minimum = 0.891
}
limit {
counter = "CLASS"
value = "MISSEDCOUNT"
// TODO: in the future the following value should become less than 10
maximum = 56
maximum = 55
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class Feedback extends DomainObject {
* null if the feedback was not created by an automatic test case.
*/
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties({ "tasks", "solutionEntries", "exercise", "coverageEntries" })
@JsonIgnoreProperties({ "tasks", "exercise" })
private ProgrammingExerciseTestCase testCase;

/**
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/de/tum/cit/aet/artemis/assessment/domain/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import jakarta.persistence.CascadeType;
Expand All @@ -28,7 +26,6 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderColumn;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import jakarta.validation.constraints.NotNull;

import org.apache.commons.lang3.StringUtils;
Expand All @@ -53,7 +50,6 @@
import de.tum.cit.aet.artemis.exercise.domain.participation.Participation;
import de.tum.cit.aet.artemis.exercise.service.ExerciseDateService;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.hestia.CoverageFileReport;
import de.tum.cit.aet.artemis.programming.dto.ResultDTO;
import de.tum.cit.aet.artemis.quiz.config.QuizView;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
Expand Down Expand Up @@ -152,13 +148,6 @@ public class Result extends DomainObject implements Comparable<Result> {
@JsonIgnore
private Instant lastModifiedDate;

// This attribute is required to forward the coverage file reports after creating the build result. This is required in order to
// delay referencing the corresponding test cases from the entries because the test cases are not saved in the database
// at this point of time but the required test case name would be lost, otherwise.
@Transient
@JsonIgnore
private Map<String, Set<CoverageFileReport>> fileReportsByTestCaseName;

public ZonedDateTime getCompletionDate() {
return completionDate;
}
Expand Down Expand Up @@ -500,14 +489,6 @@ public void setCodeIssueCount(int codeIssueCount) {
this.codeIssueCount = Math.min(codeIssueCount, SIZE_OF_UNSIGNED_TINYINT);
}

public Map<String, Set<CoverageFileReport>> getCoverageFileReportsByTestCaseName() {
return fileReportsByTestCaseName;
}

public void setCoverageFileReportsByTestCaseName(Map<String, Set<CoverageFileReport>> fileReportsByTestCaseName) {
this.fileReportsByTestCaseName = fileReportsByTestCaseName;
}

/**
* Checks the initialization status of the assessment note before returning. Only a single element is returned instead of the list,
* because it is modelled that way on the client-side. Jackson therefore needs a single object for the (de-)serialization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseParticipation;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseStudentParticipation;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTask;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTestCase;
import de.tum.cit.aet.artemis.programming.domain.build.BuildPlanType;
import de.tum.cit.aet.artemis.programming.domain.hestia.ProgrammingExerciseTask;
import de.tum.cit.aet.artemis.programming.repository.BuildJobRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseStudentParticipationRepository;
import de.tum.cit.aet.artemis.programming.repository.SolutionProgrammingExerciseParticipationRepository;
import de.tum.cit.aet.artemis.programming.repository.TemplateProgrammingExerciseParticipationRepository;
import de.tum.cit.aet.artemis.programming.service.BuildLogEntryService;
import de.tum.cit.aet.artemis.programming.service.hestia.ProgrammingExerciseTaskService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseTaskService;

@Profile(PROFILE_CORE)
@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import de.tum.cit.aet.artemis.programming.service.ProgrammingMessagingService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingTriggerService;
import de.tum.cit.aet.artemis.programming.service.ci.ContinuousIntegrationService;
import de.tum.cit.aet.artemis.programming.service.hestia.TestwiseCoverageService;

/**
* REST controller for receiving build results.
Expand All @@ -51,19 +50,15 @@ public class PublicResultResource {

private final ResultService resultService;

private final TestwiseCoverageService testwiseCoverageService;

private final ProgrammingTriggerService programmingTriggerService;

private final ProgrammingMessagingService programmingMessagingService;

public PublicResultResource(Optional<ContinuousIntegrationService> continuousIntegrationService, ProgrammingExerciseGradingService programmingExerciseGradingService,
ResultService resultService, TestwiseCoverageService testwiseCoverageService, ProgrammingTriggerService programmingTriggerService,
ProgrammingMessagingService programmingMessagingService) {
ResultService resultService, ProgrammingTriggerService programmingTriggerService, ProgrammingMessagingService programmingMessagingService) {
this.continuousIntegrationService = continuousIntegrationService;
this.programmingExerciseGradingService = programmingExerciseGradingService;
this.resultService = resultService;
this.testwiseCoverageService = testwiseCoverageService;
this.programmingTriggerService = programmingTriggerService;
this.programmingMessagingService = programmingMessagingService;
}
Expand Down Expand Up @@ -125,12 +120,6 @@ public ResponseEntity<Void> processNewProgrammingExerciseResult(@RequestHeader("
// This method will return without triggering the build if the submission is not of type TEST.
var programmingSubmission = (ProgrammingSubmission) result.getSubmission();
triggerTemplateBuildIfTestCasesChanged(participation.getProgrammingExercise().getId(), programmingSubmission);

// the test cases and the submission have been saved to the database previously, therefore we can add the reference to the coverage reports
if (Boolean.TRUE.equals(participation.getProgrammingExercise().getBuildConfig().isTestwiseCoverageEnabled()) && Boolean.TRUE.equals(result.isSuccessful())) {
testwiseCoverageService.createTestwiseCoverageReport(result.getCoverageFileReportsByTestCaseName(), participation.getProgrammingExercise(),
programmingSubmission);
}
}

programmingMessagingService.notifyUserAboutNewResult(result, participation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import de.tum.cit.aet.artemis.plagiarism.service.PlagiarismDetectionConfigHelper;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.hestia.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseImportService;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
import de.tum.cit.aet.artemis.quiz.repository.QuizExerciseRepository;
Expand Down Expand Up @@ -261,7 +261,6 @@ else if (foundByShortName.isPresent()) {

private void clearProgrammingExerciseAttributes(ProgrammingExercise programmingExercise) {
programmingExercise.setTasks(null);
programmingExercise.setExerciseHints(new HashSet<>());
programmingExercise.setTestCases(new HashSet<>());
programmingExercise.setStaticCodeAnalysisCategories(new HashSet<>());
programmingExercise.setTeams(new HashSet<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

// NOTE: this data structure is used in shared code between core and build agent nodes. Changing it requires that the shared data structures in Hazelcast (or potentially Redis)
// in the future are migrated or cleared. Changes should be communicated in release notes as potentially breaking changes.
// TODO: reduce the amount of parameters and combine some in smaller record DTOs
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record BuildConfig(String buildScript, String dockerImage, String commitHashToBuild, String assignmentCommitHash, String testCommitHash, String branch,
ProgrammingLanguage programmingLanguage, ProjectType projectType, boolean scaEnabled, boolean sequentialTestRunsEnabled, boolean testwiseCoverageEnabled,
List<String> resultPaths, int timeoutSeconds, String assignmentCheckoutPath, String testCheckoutPath, String solutionCheckoutPath, DockerRunConfig dockerRunConfig)
implements Serializable {
ProgrammingLanguage programmingLanguage, ProjectType projectType, boolean scaEnabled, boolean sequentialTestRunsEnabled, List<String> resultPaths, int timeoutSeconds,
String assignmentCheckoutPath, String testCheckoutPath, String solutionCheckoutPath, DockerRunConfig dockerRunConfig) implements Serializable {

@Override
public String dockerImage() {
Expand Down
Loading

0 comments on commit 22d38a8

Please sign in to comment.