Commit 6f0fdc53 authored by bow's avatar bow
Browse files

Rename 'unsupported' pipeline to 'plain' pipeline

parent 0664f861
......@@ -129,7 +129,7 @@ class AnnotationsControllerSpec extends SentinelServletSpec {
def upload1 = makeUpload(Users.admin, SchemaExamples.Gentrap.V04.SSampleMLib)
def upload2 = makeUpload(Users.avg2, SchemaExamples.Gentrap.V04.MSampleMLib)
def upload3 = makeUpload(Users.avg2, SchemaExamples.Gentrap.V04.MSampleSLib)
def upload4 = makeUpload(Users.avg, SchemaExamples.Unsupported)
def upload4 = makeUpload(Users.avg, SchemaExamples.Plain)
def priorRequests = Seq(upload1, upload2, upload3)
......
......@@ -128,7 +128,7 @@ class ReferencesControllerSpec extends SentinelServletSpec {
def upload1 = makeUpload(Users.admin, SchemaExamples.Gentrap.V04.SSampleMLib)
def upload2 = makeUpload(Users.avg2, SchemaExamples.Gentrap.V04.MSampleMLib)
def upload3 = makeUpload(Users.avg2, SchemaExamples.Gentrap.V04.MSampleSLib)
def upload4 = makeUpload(Users.avg, SchemaExamples.Unsupported)
def upload4 = makeUpload(Users.avg, SchemaExamples.Plain)
def priorRequests = Seq(upload1, upload2, upload3)
......
......@@ -49,13 +49,13 @@ class RunsControllerSpec extends SentinelServletSpec {
file
}
class UnsupportedUploadContext extends Context.PriorRunUploadClean {
def pipelineParam = "unsupported"
def uploadPayload = SchemaExamples.Unsupported
class PlainUploadContext extends Context.PriorRunUploadClean {
def pipelineParam = "plain"
def uploadPayload = SchemaExamples.Plain
lazy val runId = (parse(priorResponse.body) \ "runId").extract[String]
}
class UnsupportedThenGentrapUploadContext extends UnsupportedUploadContext {
class PlainThenGentrapUploadContext extends PlainUploadContext {
def pipeline2 = "gentrap"
def uploadParams2 = Seq(("userId", Users.avg2.id), ("pipeline", pipeline2))
......@@ -111,7 +111,7 @@ class RunsControllerSpec extends SentinelServletSpec {
"when the request body is empty" >> inline {
new Context.PriorRequests {
def request = () => post(endpoint, Seq(("userId", Users.avg.id), ("pipeline", "unsupported"))) { response }
def request = () => post(endpoint, Seq(("userId", Users.avg.id), ("pipeline", "plain"))) { response }
def priorRequests = Seq(request)
"return status 400" in {
......@@ -127,7 +127,7 @@ class RunsControllerSpec extends SentinelServletSpec {
"when an invalid pipeline is specified should" >> inline {
val fileMap = Map("run" -> SchemaExamples.Unsupported)
val fileMap = Map("run" -> SchemaExamples.Plain)
new Context.PriorRequests {
......@@ -146,11 +146,11 @@ class RunsControllerSpec extends SentinelServletSpec {
}
}
"using the 'unsupported' pipeline summary file" >> {
"using the 'plain' pipeline summary file" >> {
br
val pipeline = "unsupported"
def fileMap = Map("run" -> SchemaExamples.Unsupported)
val pipeline = "plain"
def fileMap = Map("run" -> SchemaExamples.Plain)
"when a run summary that passes all validation is uploaded should" >> inline {
......@@ -169,7 +169,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponse.body must /("creationTimeUtc" -> ".+".r)
priorResponse.body must /("nLibs" -> 0)
priorResponse.body must /("nSamples" -> 0)
priorResponse.body must /("pipeline" -> "unsupported")
priorResponse.body must /("pipeline" -> "plain")
priorResponse.body must /("runId" -> """\S+""".r)
priorResponse.body must /("uploaderId" -> user.id)
priorResponse.body must not /("annotIds" -> ".+".r)
......@@ -197,7 +197,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponse.body must /("creationTimeUtc" -> ".+".r)
priorResponse.body must /("nLibs" -> 0)
priorResponse.body must /("nSamples" -> 0)
priorResponse.body must /("pipeline" -> "unsupported")
priorResponse.body must /("pipeline" -> "plain")
priorResponse.body must /("runId" -> """\S+""".r)
priorResponse.body must /("uploaderId" -> user.id)
priorResponse.body must not /("annotIds" -> ".+".r)
......@@ -228,7 +228,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.head.body must /("creationTimeUtc" -> ".+".r)
priorResponses.head.body must /("nLibs" -> 0)
priorResponses.head.body must /("nSamples" -> 0)
priorResponses.head.body must /("pipeline" -> "unsupported")
priorResponses.head.body must /("pipeline" -> "plain")
priorResponses.head.body must /("runId" -> """\S+""".r)
priorResponses.head.body must /("uploaderId" -> Users.avg2.id)
priorResponses.head.body must not /("annotIds" -> ".+".r)
......@@ -245,7 +245,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.last.body must /("creationTimeUtc" -> ".+".r)
priorResponses.last.body must /("nLibs" -> 0)
priorResponses.last.body must /("nSamples" -> 0)
priorResponses.last.body must /("pipeline" -> "unsupported")
priorResponses.last.body must /("pipeline" -> "plain")
priorResponses.last.body must /("runId" -> """\S+""".r)
priorResponses.last.body must /("uploaderId" -> user.id)
priorResponses.last.body must not /("annotIds" -> ".+".r)
......@@ -335,7 +335,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.head.body must /("creationTimeUtc" -> ".+".r)
priorResponses.head.body must /("nLibs" -> 0)
priorResponses.head.body must /("nSamples" -> 0)
priorResponses.head.body must /("pipeline" -> "unsupported")
priorResponses.head.body must /("pipeline" -> "plain")
priorResponses.head.body must /("runId" -> """\S+""".r)
priorResponses.head.body must /("uploaderId" -> user.id)
priorResponses.head.body must not /("annotIds" -> ".+".r)
......@@ -379,7 +379,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.head.body must /("creationTimeUtc" -> ".+".r)
priorResponses.head.body must /("nLibs" -> 0)
priorResponses.head.body must /("nSamples" -> 0)
priorResponses.head.body must /("pipeline" -> "unsupported")
priorResponses.head.body must /("pipeline" -> "plain")
priorResponses.head.body must /("runId" -> """\S+""".r)
priorResponses.head.body must /("uploaderId" -> user.id)
priorResponses.head.body must not /("annotIds" -> ".+".r)
......@@ -624,9 +624,9 @@ class RunsControllerSpec extends SentinelServletSpec {
}
}
"using the 'unsupported' and the 'gentrap' run summary files" >> inline {
"using the 'plain' and the 'gentrap' run summary files" >> inline {
new UnsupportedThenGentrapUploadContext {
new PlainThenGentrapUploadContext {
"when the user ID is not specified" should {
......@@ -702,7 +702,7 @@ class RunsControllerSpec extends SentinelServletSpec {
jsonBody must haveSize(1)
body must /#(0) */("runId" -> """\S+""".r)
body must /#(0) */("uploaderId" -> user.id)
body must /#(0) */("pipeline" -> "unsupported")
body must /#(0) */("pipeline" -> "plain")
body must /#(0) */("nSamples" -> 0)
body must /#(0) */("nLibs" -> 0)
body must not /("sampleIds" -> ".+".r)
......@@ -757,9 +757,9 @@ class RunsControllerSpec extends SentinelServletSpec {
def endpoint(runId: String) = s"$baseEndpoint/$runId"
"using the 'unsupported' and the 'gentrap' run summary files" >> inline {
"using the 'plain' and the 'gentrap' run summary files" >> inline {
new UnsupportedThenGentrapUploadContext {
new PlainThenGentrapUploadContext {
"when the user ID is not specified" should {
......@@ -841,7 +841,7 @@ class RunsControllerSpec extends SentinelServletSpec {
body must /("uploaderId" -> user.id)
body must /("nSamples" -> 0)
body must /("nLibs" -> 0)
body must /("pipeline" -> "unsupported")
body must /("pipeline" -> "plain")
body must not /("sampleIds" -> ".+".r)
}
}
......@@ -893,7 +893,7 @@ class RunsControllerSpec extends SentinelServletSpec {
body must not /("sampleIds" -> ".+".r)
body must /("nSamples" -> 0)
body must /("nLibs" -> 0)
body must /("pipeline" -> "unsupported")
body must /("pipeline" -> "plain")
}
}
}
......@@ -958,7 +958,7 @@ class RunsControllerSpec extends SentinelServletSpec {
body must /("uploaderId" -> user.id)
body must /("nSamples" -> 0)
body must /("nLibs" -> 0)
body must /("pipeline" -> "unsupported")
body must /("pipeline" -> "plain")
body must not /("sampleIds" -> ".+".r)
}
}
......@@ -1010,7 +1010,7 @@ class RunsControllerSpec extends SentinelServletSpec {
body must not /("sampleIds" -> ".+".r)
body must /("nSamples" -> 0)
body must /("nLibs" -> 0)
body must /("pipeline" -> "unsupported")
body must /("pipeline" -> "plain")
}
}
}
......@@ -1043,9 +1043,9 @@ class RunsControllerSpec extends SentinelServletSpec {
def endpoint(runId: String) = s"$baseEndpoint/$runId"
"using the 'unsupported' run summary file" >> inline {
"using the 'plain' run summary file" >> inline {
new UnsupportedUploadContext {
new PlainUploadContext {
"when the user ID is not specified" should {
......@@ -1189,9 +1189,9 @@ class RunsControllerSpec extends SentinelServletSpec {
"when the user authenticates correctly" >> {
br
"with the default parameters for the 'unsupported' pipeline should" >> inline {
"with the default parameters for the 'plain' pipeline should" >> inline {
new UnsupportedUploadContext {
new PlainUploadContext {
val params = Seq(("userId", user.id))
val headers = Map(HeaderApiKey -> user.activeKey)
......@@ -1211,7 +1211,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.last.body must not /("sampleIds" -> ".+".r)
priorResponses.last.body must /("nSamples" -> 0)
priorResponses.last.body must /("nLibs" -> 0)
priorResponses.last.body must /("pipeline" -> "unsupported")
priorResponses.last.body must /("pipeline" -> "plain")
priorResponses.last.body must /("deletionTimeUtc" -> ".+".r)
}
......@@ -1332,9 +1332,9 @@ class RunsControllerSpec extends SentinelServletSpec {
"when an admin authenticates correctly" >> {
br
"with the default parameters for the 'unsupported' pipeline should" >> inline {
"with the default parameters for the 'plain' pipeline should" >> inline {
new UnsupportedUploadContext {
new PlainUploadContext {
val params = Seq(("userId", Users.admin.id))
val headers = Map(HeaderApiKey -> Users.admin.activeKey)
......@@ -1354,7 +1354,7 @@ class RunsControllerSpec extends SentinelServletSpec {
priorResponses.last.body must not /("sampleIds" -> ".+".r)
priorResponses.last.body must /("nSamples" -> 0)
priorResponses.last.body must /("nLibs" -> 0)
priorResponses.last.body must /("pipeline" -> "unsupported")
priorResponses.last.body must /("pipeline" -> "plain")
priorResponses.last.body must /("deletionTimeUtc" -> ".+".r)
}
......
......@@ -224,8 +224,8 @@ object SentinelServletSpec {
}
}
lazy val Unsupported = makeUploadable("/schema_examples/unsupported.json")
lazy val UnsupportedCompressed = makeUploadable("/schema_examples/unsupported.json.gz")
lazy val Plain = makeUploadable("/schema_examples/plain.json")
lazy val UnsupportedCompressed = makeUploadable("/schema_examples/plain.json.gz")
lazy val Invalid = makeUploadable("/schema_examples/invalid.json")
lazy val Not = makeUploadable("/schema_examples/not.json")
}
......
......@@ -67,7 +67,7 @@ class StatsControllerSpec extends SentinelServletSpec {
def upload1 = makeUpload(Users.admin, SchemaExamples.Gentrap.V04.SSampleMLib, "gentrap")
def upload2 = makeUpload(Users.avg, SchemaExamples.Gentrap.V04.MSampleMLib, "gentrap")
def upload3 = makeUpload(Users.avg2, SchemaExamples.Unsupported, "unsupported")
def upload3 = makeUpload(Users.avg2, SchemaExamples.Plain, "plain")
def upload4 = makeUpload(Users.avg, SchemaExamples.Gentrap.V04.MSampleSLib, "gentrap")
def priorRequests = Seq(upload1, upload2, upload3, upload4)
......@@ -114,7 +114,7 @@ class StatsControllerSpec extends SentinelServletSpec {
}
"contain statistics over the second pipeline" in {
priorResponse.body must /#(1) /("pipelineName" -> "unsupported")
priorResponse.body must /#(1) /("pipelineName" -> "plain")
priorResponse.body must /#(1) /("nLibs" -> 0)
priorResponse.body must /#(1) /("nRuns" -> 1)
priorResponse.body must /#(1) /("nSamples" -> 0)
......
......@@ -27,7 +27,7 @@ import nl.lumc.sasc.sentinel.{ AllowedPipelineParams, HeaderApiKey, Pipeline }
import nl.lumc.sasc.sentinel.api.auth.AuthenticationSupport
import nl.lumc.sasc.sentinel.db._
import nl.lumc.sasc.sentinel.processors.gentrap.GentrapV04InputProcessor
import nl.lumc.sasc.sentinel.processors.unsupported.UnsupportedInputProcessor
import nl.lumc.sasc.sentinel.processors.plain.PlainInputProcessor
import nl.lumc.sasc.sentinel.settings._
import nl.lumc.sasc.sentinel.models._
import nl.lumc.sasc.sentinel.utils._
......@@ -58,8 +58,8 @@ class RunsController(implicit val swagger: Swagger, mongo: MongodbAccessObject)
/** Adapter for connecting to users collection. */
val users = new UsersAdapter { val mongo = self.mongo }
/** Adapter for connecting to the unsupported summary collections. */
val unsupported = new UnsupportedInputProcessor(mongo)
/** Adapter for connecting to the plain summary collections. */
val plain = new PlainInputProcessor(mongo)
/** Adapter for connecting to the gentrap summary collections. */
val gentrap = new GentrapV04InputProcessor(mongo)
......@@ -179,7 +179,7 @@ class RunsController(implicit val swagger: Swagger, mongo: MongodbAccessObject)
queryParam[String]("userId").description("Run summary uploader ID."),
headerParam[String](HeaderApiKey).description("User API key."),
queryParam[String]("pipeline")
.description("Name of the pipeline that produces the uploaded summary. Valid values are `gentrap` or `unsupported`.")
.description("Name of the pipeline that produces the uploaded summary. Valid values are `gentrap` or `plain`.")
.allowableValues(AllowedPipelineParams.keySet.toList),
formParam[File]("run").description("Run summary file."))
responseMessages (
......@@ -201,8 +201,8 @@ class RunsController(implicit val swagger: Swagger, mongo: MongodbAccessObject)
val uploadedRun = fileParams.getOrElse("run", halt(400, ApiMessage("Run summary file not specified.")))
val processor = AllowedPipelineParams.get(pipeline).collect {
case Pipeline.Gentrap => gentrap
case Pipeline.Unsupported => unsupported
case Pipeline.Gentrap => gentrap
case Pipeline.Plain => plain
}
processor match {
......@@ -237,7 +237,7 @@ class RunsController(implicit val swagger: Swagger, mongo: MongodbAccessObject)
headerParam[String](HeaderApiKey).description("Run summary uploader API key."),
queryParam[Seq[String]]("pipelines")
.description(
"""Filters for summaries produced by the given pipeline. Valid values are `gentrap`, `unsupported`. If not
"""Filters for summaries produced by the given pipeline. Valid values are `gentrap`, `plain`. If not
| specified, all run summaries are returned.""".stripMargin.replaceAll("\n", ""))
.allowableValues(AllowedPipelineParams.keySet.toList)
.optional)
......
......@@ -48,7 +48,7 @@ package object sentinel {
/** Supported pipeline summary schemas */
object Pipeline extends Enumeration {
type Pipeline = Value
val Unsupported = Value("unsupported")
val Plain = Value("plain")
val Gentrap = Value("gentrap")
}
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.lumc.sasc.sentinel.processors.unsupported
package nl.lumc.sasc.sentinel.processors.plain
import java.time.Clock
import java.util.Date
......@@ -37,11 +37,11 @@ import nl.lumc.sasc.sentinel.validation.ValidationAdapter
*
* @param mongo MongoDB database access object.
*/
class UnsupportedInputProcessor(protected val mongo: MongodbAccessObject)
class PlainInputProcessor(protected val mongo: MongodbAccessObject)
extends RunsAdapter
with ValidationAdapter {
val validator = createValidator("/schemas/unsupported.json")
val validator = createValidator("/schemas/plain.json")
def processRun(fi: FileItem, user: User, pipeline: Pipeline.Value) =
......
......@@ -31,7 +31,7 @@ class GentrapValidationSpec extends Specification with JsonLoader with Mockito {
val ipv04 = new GentrapV04InputProcessor(mongo)
"exclude non-gentrap summary files" in {
val summary = loadJson("/schema_examples/unsupported.json")
val summary = loadJson("/schema_examples/plain.json")
ipv04.validator.validationMessages(summary) must not be empty
}
......
Supports Markdown
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