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