Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Oct 23, 2024
1 parent 77c9341 commit a0ad1de
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
log.info "download Quilt package: ${pkg} installed? ${pkg.installed}"
if (!pkg.installed) {
Path dest = pkg.install()
if (!dest) {
log.error "download.install failed: ${pkg}"
throw new IOException("Failed to install Quilt package: ${pkg}")
}
log.info "download.installed Quilt package to: $dest"
}

Expand Down
18 changes: 17 additions & 1 deletion plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class QuiltProductTest extends QuiltSpecification {
}

QuiltProduct makeWriteProduct(Map meta = [:]) {
String subURL = writeableURI('quilt_product_test') + '&workflow=my-workflow'
String subURL = writeableURI('quilt_product_test') // + '&workflow=universal'
if (meta) {
String query = QuiltParser.unparseQuery(meta)
subURL = subURL.replace('#', "?${query}#")
Expand Down Expand Up @@ -169,6 +169,22 @@ class QuiltProductTest extends QuiltSpecification {
quilt_summarize.size() == 1
}

void 'should copyFile'() {
given:
QuiltProduct product = makeWriteProduct()
String filename = 'test.md'
String text = 'test'
Path src = Paths.get(product.pkg.folder.toString(), filename)
Path dest = Paths.get(product.pkg.folder.toString(), 'copy', filename)
Files.writeString(src, text)

when:
product.copyFile(src, dest.toString(), text)

then:
Files.exists(dest)
}

@Ignore('Not implemented yet: pushes previous metadata')
void 'pushes previous metadata if metadata=SKIP'() {
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ class QuiltFileSystemProviderTest extends QuiltSpecification {
!Files.exists(remoteFile.localPath())

when:
provider.upload(tempFile, remoteFile)
CopyOption opt = StandardCopyOption.REPLACE_EXISTING
provider.upload(tempFile, remoteFile, opt)

then:
Files.exists(remoteFile)
Expand Down

0 comments on commit a0ad1de

Please sign in to comment.