Verified Commit 3fac9b7e authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

chore: remove all leftover modocot occurences

parent 02f47324
......@@ -29,7 +29,7 @@ public class TaskUpload {
private static final Logger LOG = LogManager.getLogger(TaskUpload.class);
private final JGitUtil jGitUtil;
private final Path testTmpPathModocot;
private final Path testTmpPath;
private final ExecuteTestUtil executeTestUtil;
public TaskUpload(
......@@ -41,7 +41,7 @@ public class TaskUpload {
this.executeTestUtil = executeTestUtil;
// set path of temporary directory on host and inside our container
this.testTmpPathModocot = Paths.get(env.getProperty("tests.tmp.dir"));
this.testTmpPath = Paths.get(env.getProperty("tests.tmp.dir"));
}
@RequestMapping(method = RequestMethod.POST)
......@@ -51,7 +51,7 @@ public class TaskUpload {
LOG.info("submission for testing received");
LOG.debug("creating new temporary directory");
Path workDirectory = Files.createTempDirectory(testTmpPathModocot, "modocot");
Path workDirectory = Files.createTempDirectory(testTmpPath, "dtt");
LOG.debug(String.format("working dir for test is: %s", workDirectory.toAbsolutePath().toString()));
// define paths for the test, the submission and where the result is to be expected afterwards
......@@ -60,9 +60,9 @@ public class TaskUpload {
String mimeInfo = new Tika().detect(taskFileRef.getInputStream());
switch (mimeInfo) {
case "text/plain":
LOG.debug("textfile uploaded, searching for modocot config");
// find modocot URI in config file
Matcher config = RegexUtil.findModocotStudentConfig(taskFileRef.getInputStream());
LOG.debug("textfile uploaded, searching for dtt config");
// find URI in config file
Matcher config = RegexUtil.findStudentConfig(taskFileRef.getInputStream());
LOG.debug("calling repo clone");
jGitUtil.cloneRepository(config, srcPath.toAbsolutePath().toString());
......
......@@ -74,11 +74,11 @@ public class UnitTestUpload {
new FileInputStream(file)))) {
String line;
// search for a modocot URI while none is found and there are lines left
// search for a URI while none is found and there are lines left
while (config == null && (line = br.readLine()) != null) {
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
LOG.debug(String.format("found modocot test line: %s", line));
LOG.debug(String.format("found dtt test line: %s", line));
config = matcher;
}
}
......
......@@ -23,7 +23,7 @@ public class ExecuteTestUtil {
private final DockerUtil dockerUtil;
private final String assignmentBasePath;
private final Path testTmpPathHost;
private final Path testTmpPathModocot;
private final Path testTmpPath;
public ExecuteTestUtil(
Environment env,
......@@ -41,7 +41,7 @@ public class ExecuteTestUtil {
// set path of temporary directory on host and inside our container
this.testTmpPathHost = Paths.get(env.getProperty("host.tests.tmp.dir"));
this.testTmpPathModocot = Paths.get(env.getProperty("tests.tmp.dir"));
this.testTmpPath = Paths.get(env.getProperty("tests.tmp.dir"));
}
public ResultSummary runTests(String assignmentId, Path workDirectory) throws IOException, InterruptedException {
......@@ -76,7 +76,7 @@ public class ExecuteTestUtil {
Files.createDirectory(resultPath);
LOG.info("reading test config");
Matcher config = RegexUtil.findModocotProfessorConfig(
Matcher config = RegexUtil.findProfessorConfig(
new FileInputStream(Paths.get(workDirectory.toAbsolutePath().toString(), "config.txt").toFile()));
// define the paths to mount as Binds from Host to the test-container
......
......@@ -20,15 +20,15 @@ public class RegexUtil {
private static final Logger LOG = LogManager.getLogger(RegexUtil.class);
public static Matcher findModocotStudentConfig(InputStream is) {
return findModoctConfig(is, ConfigType.STUDENT);
public static Matcher findStudentConfig(InputStream is) {
return findConfig(is, ConfigType.STUDENT);
}
public static Matcher findModocotProfessorConfig(InputStream is) {
return findModoctConfig(is, ConfigType.PROFESSOR);
public static Matcher findProfessorConfig(InputStream is) {
return findConfig(is, ConfigType.PROFESSOR);
}
public static Matcher findModoctConfig(InputStream is, ConfigType configType) {
public static Matcher findConfig(InputStream is, ConfigType configType) {
Pattern pattern;
switch (configType) {
case PROFESSOR:
......@@ -58,7 +58,7 @@ public class RegexUtil {
while (config == null && (line = br.readLine()) != null) {
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
LOG.debug(String.format("found modocot line: %s", line));
LOG.debug(String.format("found dtt line: %s", line));
config = matcher;
}
}
......
......@@ -26,8 +26,8 @@ public class UnifiedTicketingUtil {
private final static Logger LOG = LogManager.getLogger(UnifiedTicketingUtil.class);
private final static String MODOCOT_LABEL = "MoDoCoT created";
private final static String MODOCOT_TITLE = " | " + MODOCOT_LABEL;
private final static String LABEL = "DTT created";
private final static String TITLE = " | " + LABEL;
public static String createTicketDescriptionFromResult(TicketSystem ts, Result result, boolean compilationError) {
StringBuilder sb = new StringBuilder();
......@@ -89,7 +89,7 @@ public class UnifiedTicketingUtil {
}
// if label-support is not present, place global identifier into title
if (!ts.hasLabelSupport()) sb.append(MODOCOT_TITLE);
if (!ts.hasLabelSupport()) sb.append(TITLE);
sb.append(separator);
sb.append(getHashForFailure(result));
......@@ -102,25 +102,25 @@ public class UnifiedTicketingUtil {
.title(createTicketTitleFromResult(ts, result, compilationError))
.description(createTicketDescriptionFromResult(ts, result, compilationError));
if (ts.hasLabelSupport()) tb.labels(Collections.singleton(MODOCOT_LABEL));
if (ts.hasLabelSupport()) tb.labels(Collections.singleton(LABEL));
return tb.create();
}
public static Set<Ticket> fetchExistingModocotTickets(TicketSystem ts) {
public static Set<Ticket> fetchExistingTickets(TicketSystem ts) {
Set<Ticket> ret = new HashSet<>();
Filter f = ts.find();
// depending on label support, identify MoDoCoT tickets by label or title containing string
// depending on label support, identify tickets by label or title containing string
if (ts.hasLabelSupport()) {
LOG.debug(String.format(
"ticketsystem has label support, using label %s to find modocot tickets", MODOCOT_LABEL));
f.withLabel(MODOCOT_LABEL);
"ticketsystem has label support, using label %s to find dtt tickets", LABEL));
f.withLabel(LABEL);
}
else {
LOG.debug(String.format(
"ticketsystem without labels, searching for ticket titles containing %s", MODOCOT_TITLE));
f.withTitleContain(MODOCOT_TITLE);
"ticketsystem without labels, searching for ticket titles containing %s", TITLE));
f.withTitleContain(TITLE);
}
LOG.debug("prepare pagination cycling");
......@@ -260,7 +260,7 @@ public class UnifiedTicketingUtil {
public static void reportToTicketsystem(TicketSystem ts, ResultSummary resultSummary) {
// tickets existing yet
LOG.debug("fetching existing tickets");
Set<Ticket> tickets = fetchExistingModocotTickets(ts);
Set<Ticket> tickets = fetchExistingTickets(ts);
// for each fail or compile error
LOG.debug("start failed tests reporting");
......@@ -281,7 +281,7 @@ public class UnifiedTicketingUtil {
.open()
.setTitle(createTicketTitleFromResult(ts, result, compilationError))
.setDescription(createTicketDescriptionFromResult(ts, result, compilationError));
if (ts.hasLabelSupport()) ticket.addLabel(MODOCOT_LABEL);
if (ts.hasLabelSupport()) ticket.addLabel(LABEL);
return ticket.save();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment