From b111b7d04a4f1de472d4b5736018eb123fdc50bb Mon Sep 17 00:00:00 2001 From: ledoyen Date: Tue, 17 Sep 2024 02:51:11 +0200 Subject: [PATCH] Upgrade to KTK 1.4.4 (handle CI permission error) --- pom.xml | 2 +- .../korekto/grader/basis/BasisGrader.java | 23 +------------------ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 5a5867e..f0fef2d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 21 21 - 1.4.2 + 1.4.3 1.5.8 2.5.0 5.11.0 diff --git a/src/main/java/com/github/lernejo/korekto/grader/basis/BasisGrader.java b/src/main/java/com/github/lernejo/korekto/grader/basis/BasisGrader.java index a92ce7b..2a6207c 100644 --- a/src/main/java/com/github/lernejo/korekto/grader/basis/BasisGrader.java +++ b/src/main/java/com/github/lernejo/korekto/grader/basis/BasisGrader.java @@ -1,24 +1,18 @@ package com.github.lernejo.korekto.grader.basis; import com.github.lernejo.korekto.grader.basis.parts.Part1Grader; -import com.github.lernejo.korekto.toolkit.GradePart; import com.github.lernejo.korekto.toolkit.Grader; import com.github.lernejo.korekto.toolkit.GradingConfiguration; import com.github.lernejo.korekto.toolkit.PartGrader; -import com.github.lernejo.korekto.toolkit.misc.HumanReadableDuration; import com.github.lernejo.korekto.toolkit.partgrader.GitHubActionsPartGrader; import com.github.lernejo.korekto.toolkit.partgrader.JacocoCoveragePartGrader; import com.github.lernejo.korekto.toolkit.partgrader.MavenCompileAndTestPartGrader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.Collection; import java.util.List; public class BasisGrader implements Grader { - private final Logger logger = LoggerFactory.getLogger(BasisGrader.class); - @Override public String name() { return "korekto-java-basis-grader"; @@ -39,22 +33,7 @@ public void run(LaunchingContext context) { context.getGradeDetails().getParts().addAll(grade(context)); } - private Collection grade(LaunchingContext context) { - return graders().stream() - .map(g -> applyPartGrader(context, g)) - .toList(); - } - - private GradePart applyPartGrader(LaunchingContext context, PartGrader g) { - long startTime = System.currentTimeMillis(); - try { - return g.grade(context); - } finally { - logger.debug("{} in {}", g.name(), HumanReadableDuration.toString(System.currentTimeMillis() - startTime)); - } - } - - private Collection> graders() { + public Collection> graders() { return List.of( new Part1Grader("Part 1 - Git History", 4.0D, 0.5D), new MavenCompileAndTestPartGrader<>(