Skip to content

Commit

Permalink
Upgrade to KTK 1.4.4 (handle CI permission error)
Browse files Browse the repository at this point in the history
  • Loading branch information
ledoyen committed Sep 17, 2024
1 parent 21da8ee commit b111b7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>

<korekto-toolkit.version>1.4.2</korekto-toolkit.version>
<korekto-toolkit.version>1.4.3</korekto-toolkit.version>
<logback.version>1.5.8</logback.version>
<juniversalchardet.version>2.5.0</juniversalchardet.version>
<junit.version>5.11.0</junit.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -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<LaunchingContext> {

private final Logger logger = LoggerFactory.getLogger(BasisGrader.class);

@Override
public String name() {
return "korekto-java-basis-grader";
Expand All @@ -39,22 +33,7 @@ public void run(LaunchingContext context) {
context.getGradeDetails().getParts().addAll(grade(context));
}

private Collection<? extends GradePart> grade(LaunchingContext context) {
return graders().stream()
.map(g -> applyPartGrader(context, g))
.toList();
}

private GradePart applyPartGrader(LaunchingContext context, PartGrader<LaunchingContext> g) {
long startTime = System.currentTimeMillis();
try {
return g.grade(context);
} finally {
logger.debug("{} in {}", g.name(), HumanReadableDuration.toString(System.currentTimeMillis() - startTime));
}
}

private Collection<? extends PartGrader<LaunchingContext>> graders() {
public Collection<PartGrader<LaunchingContext>> graders() {
return List.of(
new Part1Grader("Part 1 - Git History", 4.0D, 0.5D),
new MavenCompileAndTestPartGrader<>(
Expand Down

0 comments on commit b111b7d

Please sign in to comment.