Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dockerized Testing Toolkit
DTT Backend
Commits
3fac9b7e
Verified
Commit
3fac9b7e
authored
Mar 23, 2021
by
Lukas Wiest
🚂
Browse files
chore: remove all leftover modocot occurences
parent
02f47324
Changes
5
Show whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/rest/v1/task/TaskUpload.java
View file @
3fac9b7e
...
...
@@ -29,7 +29,7 @@ public class TaskUpload {
private
static
final
Logger
LOG
=
LogManager
.
getLogger
(
TaskUpload
.
class
);
private
final
JGitUtil
jGitUtil
;
private
final
Path
testTmpPath
Modocot
;
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
.
testTmpPath
Modocot
=
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
(
testTmpPath
Modocot
,
"modoco
t"
);
Path
workDirectory
=
Files
.
createTempDirectory
(
testTmpPath
,
"dt
t"
);
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
modoco
t config"
);
// find
modocot
URI in config file
Matcher
config
=
RegexUtil
.
find
Modocot
StudentConfig
(
taskFileRef
.
getInputStream
());
LOG
.
debug
(
"textfile uploaded, searching for
dt
t config"
);
// find URI in config file
Matcher
config
=
RegexUtil
.
findStudentConfig
(
taskFileRef
.
getInputStream
());
LOG
.
debug
(
"calling repo clone"
);
jGitUtil
.
cloneRepository
(
config
,
srcPath
.
toAbsolutePath
().
toString
());
...
...
src/main/java/de/hftstuttgart/rest/v1/unittest/UnitTestUpload.java
View file @
3fac9b7e
...
...
@@ -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
modoco
t test line: %s"
,
line
));
LOG
.
debug
(
String
.
format
(
"found
dt
t test line: %s"
,
line
));
config
=
matcher
;
}
}
...
...
src/main/java/de/hftstuttgart/utils/ExecuteTestUtil.java
View file @
3fac9b7e
...
...
@@ -23,7 +23,7 @@ public class ExecuteTestUtil {
private
final
DockerUtil
dockerUtil
;
private
final
String
assignmentBasePath
;
private
final
Path
testTmpPathHost
;
private
final
Path
testTmpPath
Modocot
;
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
.
testTmpPath
Modocot
=
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
.
find
Modocot
ProfessorConfig
(
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
...
...
src/main/java/de/hftstuttgart/utils/RegexUtil.java
View file @
3fac9b7e
...
...
@@ -20,15 +20,15 @@ public class RegexUtil {
private
static
final
Logger
LOG
=
LogManager
.
getLogger
(
RegexUtil
.
class
);
public
static
Matcher
find
Modocot
StudentConfig
(
InputStream
is
)
{
return
find
Modoct
Config
(
is
,
ConfigType
.
STUDENT
);
public
static
Matcher
findStudentConfig
(
InputStream
is
)
{
return
findConfig
(
is
,
ConfigType
.
STUDENT
);
}
public
static
Matcher
find
Modocot
ProfessorConfig
(
InputStream
is
)
{
return
find
Modoct
Config
(
is
,
ConfigType
.
PROFESSOR
);
public
static
Matcher
findProfessorConfig
(
InputStream
is
)
{
return
findConfig
(
is
,
ConfigType
.
PROFESSOR
);
}
public
static
Matcher
find
Modoct
Config
(
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
modoco
t line: %s"
,
line
));
LOG
.
debug
(
String
.
format
(
"found
dt
t line: %s"
,
line
));
config
=
matcher
;
}
}
...
...
src/main/java/de/hftstuttgart/utils/UnifiedTicketingUtil.java
View file @
3fac9b7e
...
...
@@ -26,8 +26,8 @@ public class UnifiedTicketingUtil {
private
final
static
Logger
LOG
=
LogManager
.
getLogger
(
UnifiedTicketingUtil
.
class
);
private
final
static
String
MODOCOT_
LABEL
=
"
MoDoCo
T created"
;
private
final
static
String
MODOCOT_
TITLE
=
" | "
+
MODOCOT_
LABEL
;
private
final
static
String
LABEL
=
"
DT
T 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
>
fetchExisting
Modocot
Tickets
(
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
modoco
t tickets"
,
MODOCOT_
LABEL
));
f
.
withLabel
(
MODOCOT_
LABEL
);
"ticketsystem has label support, using label %s to find
dt
t 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
=
fetchExisting
Modocot
Tickets
(
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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment