From 45ca36dfe23418f272f4d6689b018a860df67d9a Mon Sep 17 00:00:00 2001 From: Dan Billings Date: Thu, 25 May 2017 13:25:00 -0400 Subject: [PATCH] added README and CHANGELOG comments --- .idea/inspectionProfiles/Project_Default.xml | 6 ++++++ CHANGELOG.md | 1 + README.md | 9 +++++++++ backend/src/test/scala/cromwell/backend/wdl/FileSizeSpec.scala | 9 ++++----- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..de31e99ed --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index b50bc84f5..7403cacc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,7 @@ google { ### General Changes * The `/query` endpoint now supports querying by `label`. See the [README](README.md#get-apiworkflowsversionquery) for more information. +* The `read_X` standard library functions limit accepted filesizes. These differ by type, e.g. read_bool has a smaller limit than read_string. See reference.conf for default settings. ## 26 diff --git a/README.md b/README.md index 7d65ebee7..866c5c8c3 100644 --- a/README.md +++ b/README.md @@ -198,14 +198,23 @@ For many examples on how to use WDL see [the WDL site](https://github.com/broadi * [File stdout()](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#file-stdout) * [File stderr()](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#file-stderr) * [Array\[String\] read_lines(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#arraystring-read_linesstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Array\[Array\[String\]\] read_tsv(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#arrayarraystring-read_tsvstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Map\[String, String\] read_map(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#mapstring-string-read_mapstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Object read_object(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#object-read_objectstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Array\[Object\] read_objects(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#arrayobject-read_objectsstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Int read_int(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#int-read_intstringfile) + * File reads are limited to 19 B. Configurable via conf file. * [String read_string(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#string-read_stringstringfile) + * File reads are limited to 128 KB. Configurable via conf file. * [Float read_float(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#float-read_floatstringfile) + * File reads are limited to 50 B. Configurable via conf file. * [Boolean read_boolean(String|File)](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#boolean-read_booleanstringfile) + * File reads are limited to 7 B. Configurable via conf file. * [File write_lines(Array\[String\])](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#file-write_linesarraystring) * [File write_tsv(Array\[Array\[String\]\])](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#file-write_tsvarrayarraystring) * [File write_map(Map\[String, String\])](https://github.com/broadinstitute/wdl/blob/develop/SPEC.md#file-write_mapmapstring-string) diff --git a/backend/src/test/scala/cromwell/backend/wdl/FileSizeSpec.scala b/backend/src/test/scala/cromwell/backend/wdl/FileSizeSpec.scala index d89246855..018fec6ae 100644 --- a/backend/src/test/scala/cromwell/backend/wdl/FileSizeSpec.scala +++ b/backend/src/test/scala/cromwell/backend/wdl/FileSizeSpec.scala @@ -49,14 +49,14 @@ class FileSizeSpec extends FlatSpec with Matchers { def testOverUnder(command: String, n: Int, f: ReadLikeFunctions => (Seq[Try[WdlValue]] =>Try[WdlValue])) = { - def testInner(n: Int, g: Try[WdlValue] => Unit) = { + def testInner(n: Int, test: Try[WdlValue] => Unit) = { - def createTempFileOfSize(n: Int): Path = { + def createTempFileOfSize(size: Int): Path = { val fn = tempDir.toString + "/" + scala.util.Random.alphanumeric.take(5).mkString val jPath = Paths.get(fn) jPath.toFile.deleteOnExit - val start = Stream[Task, Byte](1).repeat.take(n.toLong) + val start = Stream[Task, Byte](1).repeat.take(size.toLong) val end = fs2.io.file.writeAll[Task](jPath, Seq(CREATE_NEW, WRITE) ) (start to end).run.unsafeRunSync //jPath is now a file of n bytes, we can return it @@ -66,9 +66,8 @@ class FileSizeSpec extends FlatSpec with Matchers { val file = createTempFileOfSize(n) val params = Seq(Try(WdlString(file.toString))) - //apply the test "g" f(rlf)(params) match { - case t => g(t) + case t => test(t) } }