From e8616715997dcc531c103f09e871404196abc51b Mon Sep 17 00:00:00 2001 From: Ernest Prabhakar Date: Tue, 3 Oct 2023 10:28:59 -0700 Subject: [PATCH] QuiltProduct.README_FILE --- .../nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy | 3 ++- .../src/test/nextflow/quilt/jep/QuiltPackageTest.groovy | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index add707f2..8efd9973 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -43,6 +43,7 @@ import groovy.json.JsonOutput @Slf4j @CompileStatic class QuiltProduct { + public final static String README_FILE = 'README.md' private final static String KEY_META = 'metadata' private final static String KEY_README = 'readme' @@ -213,7 +214,7 @@ ${meta['workflow']['stats']['processes']} } if (text != null && text.length() > 0) { //log.debug("setupReadme: ${text.length()} bytes") - writeString(text, pkg, 'README.md') + writeString(text, pkg, README_FILE) } return text } diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy index 4e04570f..7a69dfea 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy @@ -19,6 +19,7 @@ package nextflow.quilt.jep import nextflow.quilt.QuiltSpecification import nextflow.quilt.nio.QuiltPathFactory import nextflow.quilt.nio.QuiltPath +import nextflow.quilt.QuiltProduct import spock.lang.Ignore import spock.lang.IgnoreIf @@ -39,7 +40,7 @@ import groovy.transform.CompileDynamic class QuiltPackageTest extends QuiltSpecification { private final static String PACKAGE_URL = 'quilt+s3://quilt-example#package=examples%2fsmart-report@d68a7e9' - private final static String TEST_URL = PACKAGE_URL + '&path=README.md' + private final static String TEST_URL = PACKAGE_URL + "&path=${QuiltProduct.README_FILE}" private QuiltPathFactory factory private QuiltPath qpath @@ -149,7 +150,7 @@ class QuiltPackageTest extends QuiltSpecification { given: def qout = factory.parseUri(TEST_URL) def opkg = qout.pkg() - def outPath = Paths.get(opkg.packageDest().toString(), 'README.md') + def outPath = Paths.get(opkg.packageDest().toString(), QuiltProduct.README_FILE) Files.writeString(outPath, "Time: ${timestamp}") expect: Files.exists(outPath) @@ -171,7 +172,7 @@ class QuiltPackageTest extends QuiltSpecification { void 'should succeed pushing new files to writeable bucket '() { given: QuiltPackage opkg = writeablePackage('observer') - def outPath = Paths.get(opkg.packageDest().toString(), 'README.md') + def outPath = Paths.get(opkg.packageDest().toString(), QuiltProduct.README_FILE) Files.writeString(outPath, "Time: ${timestamp}") expect: Files.exists(outPath)