-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backend unit tests for nml parser and writer #2829
Conversation
@jstriebel these tests currently run in the |
@youri-k, do you mean the docker-compose service |
Right |
@youri-k: I just added a docker-compose service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome PR, testing this makes so much sense! 🎉
Only left some minor remarks, besides that LVGTM 👍
@@ -140,7 +140,7 @@ object NmlParser extends LazyLogging with ProtoGeometryImplicits { | |||
} | |||
|
|||
private def parseEditRotation(node: NodeSeq) = { | |||
node.headOption.flatMap(parseRotation) | |||
node.headOption.flatMap(parseRotationForParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this fixes a bug you found with the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is because of difference in parsing EditRotation
of nodes
and the general param
test/backend/NMLUnitTestSuite.scala
Outdated
|
||
def getObjectId = ObjectId.fromBsonId(BSONObjectID.generate) | ||
|
||
def getParsedTracing(tracing: SkeletonTracing) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather rename this to something more active, as it is not a typical getter
. Maybe writeAndParseTracing
.
test/backend/NMLUnitTestSuite.scala
Outdated
} | ||
} | ||
|
||
"NML Parser" should "throw an error for invalid comment state" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add why this is invalid here.
test/backend/NMLUnitTestSuite.scala
Outdated
//TODO: The parser currently doesn't check this | ||
} | ||
|
||
it should "throw an error for invalid branchPoint state" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add why this is invalid here.
test/backend/NMLUnitTestSuite.scala
Outdated
//TODO: The parser currently doesn't check this | ||
} | ||
|
||
it should "throw an error for invalid edge state" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
…sos into backend-unit-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🎉
…e-validation improve the backend tree validator
Steps to test:
sbt "test-only *NMLUnitTestSuite"
in wK directory to see the tests runningIssues: