Skip to content

Commit

Permalink
QuiltProduct.README_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Oct 3, 2023
1 parent 8e4156a commit e861671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e861671

Please sign in to comment.