Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-lab-base
Commits
a23932a4
Commit
a23932a4
authored
Jul 16, 2018
by
Ihrig, Arvid Conrad (ari)
Browse files
Integrated Pipeline: added end-to-end test for graceful failure of non-existent file-trees
parent
9df20630
Changes
2
Hide whitespace changes
Inline
Side-by-side
integrated-pipeline/src/test/scala/eu/nomad_lab/integrated_pipeline_end_to_end_tests/UnderDevelopment.scala
View file @
a23932a4
package
eu.nomad_lab.integrated_pipeline_end_to_end_tests
import
org.scalatest.AsyncWordSpec
import
java.io.ByteArrayOutputStream
import
eu.nomad_lab.TreeType
import
eu.nomad_lab.integrated_pipeline.
{
Main
,
OutputType
}
import
org.scalatest.
{
AsyncWordSpec
,
Matchers
}
import
eu.nomad_lab.integrated_pipeline_tests.
{
EndToEnd
,
PendingEndToEnd
}
import
scala.util.Properties
/**
* This Test Suite contains the End-to-End tests for the Integrated Pipeline that are not yet
...
...
@@ -9,9 +16,23 @@ import org.scalatest.AsyncWordSpec
* These tests validate some basic assumptions on the generated output, but the queries made are
* simple enough to assume that the tests are independent of the parser versions.
*/
class
UnderDevelopment
extends
AsyncWordSpec
{
class
UnderDevelopment
extends
AsyncWordSpec
with
Matchers
{
"The Integrated Pipeline"
when
{
"invoked in console mode"
should
{
"skip parse requests for non-existent file tree and log a warning"
taggedAs
(
EndToEnd
,
PendingEndToEnd
)
in
{
val
f
=
new
NonExistingTreeFixture
(
TreeType
.
Directory
,
OutputType
.
Json
)
val
output
=
new
ByteArrayOutputStream
()
Console
.
withOut
(
output
)
{
val
finished
=
Main
.
mainWithFuture
(
f
.
generateConsoleArgumentList
(
Some
(
info
)))
finished
.
map
{
_
=>
//TODO: is it worth the effort to have a streaming implementation here?
val
lines
=
output
.
toString
.
split
(
Properties
.
lineSeparator
)
atLeast
(
1
,
lines
)
should
(
include
(
"purely-imaginary"
)
and
include
(
"not exist"
)
and
include
(
"skipping file tree"
))
}
}
}
}
}
}
integrated-pipeline/src/test/scala/eu/nomad_lab/integrated_pipeline_end_to_end_tests/package.scala
View file @
a23932a4
...
...
@@ -68,6 +68,11 @@ package object integrated_pipeline_end_to_end_tests extends TestDataBuilders {
override
val
sample
:
TestTreeData
=
testData3
}
class
NonExistingTreeFixture
(
val
treeType
:
TreeType
,
val
outputType
:
OutputType
)
extends
Fixture
{
override
val
numWorkers
:
Int
=
1
override
val
sample
:
TestTreeData
=
TestTreeData
(
"purely-imaginary"
,
Map
())
}
def
assertValidityOfGeneratedJsonFiles
(
sample
:
TestTreeData
,
treeTask
:
FileTreeScanTask
,
tmpResultsFolder
:
Path
,
metaInfo
:
MetaInfoEnv
)
:
Assertion
=
{
sample
.
candidateCalculationsWithParsers
.
foreach
{
entry
=>
...
...
Write
Preview
Supports
Markdown
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