-
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
Fix nml upload with only ds name in nml by using user's orga as fallback #8277
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import com.scalableminds.webknossos.datastore.SkeletonTracing._ | |
import com.scalableminds.webknossos.datastore.geometry.{AdditionalAxisProto, Vec2IntProto} | ||
import com.scalableminds.webknossos.datastore.models.annotation.{AnnotationLayer, FetchedAnnotationLayer} | ||
import com.scalableminds.webknossos.tracingstore.tracings.volume.VolumeDataZipFormat | ||
import models.annotation.SharedParsingParameters | ||
import models.annotation.nml.{NmlParseSuccessWithoutFile, NmlParser, NmlWriter} | ||
import net.liftweb.common.{Box, Full} | ||
import org.apache.commons.io.output.ByteArrayOutputStream | ||
|
@@ -54,8 +55,10 @@ class NMLUnitTestSuite @Inject()(nmlParser: NmlParser) extends PlaySpec { | |
.parse( | ||
"", | ||
new ByteArrayInputStream(array), | ||
overwritingDatasetId = None, | ||
isTaskUpload = true, | ||
SharedParsingParameters(useZipName = false, | ||
overwritingDatasetId = None, | ||
userOrganizationId = "testOrganization", | ||
isTaskUpload = true), | ||
Comment on lines
+58
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add test coverage for organization fallback behavior. While the parameter changes look good, considering the PR's objective to "Fix nml upload with only ds name in nml by using user's orga as fallback", we should add test cases to verify this specific behavior. Consider adding test cases that:
Example test case structure: "NML Parser" should {
"use user's organization as fallback when only dataset name is provided" in {
// Setup tracing without datasetId
val tracingWithoutDatasetId = dummyTracing.copy(/* setup without datasetId */)
writeAndParseTracing(tracingWithoutDatasetId) match {
case Full(NmlParseSuccessWithoutFile(Some(tracing), _, _, _, _)) =>
// Verify organization fallback worked
assert(/* verify organization fallback */)
case _ => fail("Should succeed with organization fallback")
}
}
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fm3 Writing such a test is rather difficult as the nmls for the tests are generated with => I skipped this for now but it should be useful for the future to avoid this regression bug introduced by #8075 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are your thoughts on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’d say this is part of the broader problem of testing the libs and webknossos together. That’s a topic we’ll definitely discuss next year. |
||
basePath = None | ||
)(messagesProvider, scala.concurrent.ExecutionContext.global, GlobalAccessContext) | ||
.futureBox, | ||
|
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.
all members of sharedParsingParameters are passed to
nmlParser.parse
anyway. So just pass the wholesharedParsingParameters
object