Skip to content

Commit

Permalink
iterate over package folders/files
Browse files Browse the repository at this point in the history
Correct package version
  • Loading branch information
drernie committed Aug 27, 2024
1 parent 70c4d94 commit 8e45518
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class QuiltNioTest extends QuiltSpecification {

private static final String NULL_URL = 'quilt+s3://quilt-dev-null#package=test/null'
//https://open.quiltdata.com/b/quilt-example/tree/examples/hurdat/
private static final String PACKAGE_URL = 'quilt+s3://quilt-example#package=examples/hurdat@f8d1478d93'
private static final String HASH = 'f8d1478d9326e1c98ded6e933c1aa19cf8913735bdcf0be6ccf0efd3b02218f4'
private static final String PACKAGE_URL = "quilt+s3://quilt-example#package=examples/hurdat@${HASH}"
private static final String WRITE_URL = packagePath('folder/file-name.txt')
private static final String READ_URL = packagePath('data/atlantic-storms.csv')
private static final String TEXT = 'Hello world!'
Expand Down Expand Up @@ -237,32 +238,23 @@ class QuiltNioTest extends QuiltSpecification {
pkg.relativeChildren('')
}

/* FIXME: Test fails on Windows and Ubuntu. STDOUT shows:
Children: [README_NF_QUILT.md, alpha, bolder, create.txt, data, folder,
nf-quilt, notebooks, quilt_summarize.json, scripts, stream.txt]
Test has: [path=data, path=folder, path=notebooks,
path=quilt_summarize.json, path=scripts, path=stream.txt]
*/
// @IgnoreIf({ System.getProperty('os.name').contains('indows') || System.getProperty('os.name').contains('ux') })
void 'should iterate over package folders/files'() {
given:
Path path = Paths.get(new URI(PACKAGE_URL))
when:
QuiltPathIterator itr = new QuiltPathIterator(path, null)
println "ITR: ${itr}"
then:
itr != null
itr.hasNext()

when:
String[] ilist = itr*.toString()*.replaceFirst('quilt-example#package=examples%2fhurdat&', '').toArray()
println "ILIST: ${ilist}"
String[] ilist = itr*.toString()*.replaceFirst('quilt-example#package=examples%2fhurdat&path=', '').toArray()
then:
ilist.size() > 4
ilist.contains('path=README_NF_QUILT.md')
ilist.contains('path=data')
ilist.contains('path=folder')
ilist.contains('path=scripts')
ilist.contains('quilt_summarize.json')
ilist.contains('data')
ilist.contains('notebooks')
ilist.contains('scripts')
}

void 'should create a directory'() {
Expand Down

0 comments on commit 8e45518

Please sign in to comment.