From 6f4d25e5abf09aa1d9f492574617b66972a7148e Mon Sep 17 00:00:00 2001 From: Ernest Prabhakar Date: Fri, 8 Sep 2023 13:18:31 -0700 Subject: [PATCH 1/3] no popd in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0fa72f4a..44c15891 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ compile: nextflow: if [ ! -d "$(NF_DIR)" ]; then git clone https://github.com/nextflow-io/nextflow.git "$(NF_DIR)"; fi - pushd "$(NF_DIR)"; git checkout && make compile && git restore .; popd + cd "$(NF_DIR)" && git checkout && make compile && ./nextflow -v compile-all: nextflow compile From 52bdba6e9c1af1a9604e95c5c908d7fb60e2e652 Mon Sep 17 00:00:00 2001 From: Ernest Prabhakar Date: Fri, 8 Sep 2023 13:23:28 -0700 Subject: [PATCH 2/3] drop pkg-test --- .github/workflows/pkg-test.yml | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 .github/workflows/pkg-test.yml diff --git a/.github/workflows/pkg-test.yml b/.github/workflows/pkg-test.yml deleted file mode 100644 index 48acbbd6..00000000 --- a/.github/workflows/pkg-test.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Test - -on: - # Trigger at every push. Action will also be visible from Pull Requests to master - push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) - pull_request: - branches: [master] - -permissions: read-all - -jobs: - build: - name: Test - permissions: - contents: read - id-token: write - issues: write - pull-requests: write - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - java_version: [19] - runs-on: ${{ matrix.os }} - - steps: - # Git Checkout - - name: Checkout Code - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: arn:aws:iam::712023778557:role/GitHub-Testing-NF-Quilt - aws-region: us-east-1 - - - name: Setup Java ${{matrix.java_version}} - uses: actions/setup-java@v3 - with: - java-version: ${{matrix.java_version}} - distribution: 'temurin' - architecture: x64 - cache: gradle - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - - name: Run Package Tests - run: make pkg-test - - - name: Archive production artifacts - if: ${{ success() }} || ${{ failure() }} - uses: actions/upload-artifact@v3 - with: - name: nf-quilt-pkg-test - path: | - /home/runner/work/nf-quilt/nf-quilt/plugins/nf-quilt/build/reports/tests/test/ From 01b268e2379c731b9b93a3a37396971dc8b706bd Mon Sep 17 00:00:00 2001 From: Ernest Prabhakar Date: Fri, 8 Sep 2023 16:50:14 -0700 Subject: [PATCH 3/3] fail relativeChildren --- .../nextflow/quilt/jep/QuiltPackage.groovy | 15 ++++++-------- .../quilt/jep/QuiltPackageTest.groovy | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index 34e10406..54bd7874 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -161,15 +161,13 @@ class QuiltPackage { */ List relativeChildren(String subpath) { - Manifest manifest = packageManifest() - // get names of entries - List children = manifest.getEntries().keySet().collect { String key -> - if (key.startsWith(subpath)) { - return key - } - return null + Set keys = packageManifest().getEntries().keySet() + println("relativeChildren[${subpath}]: ${keys}") + Collection children = keys.findResults { String key -> + key.startsWith(subpath) ? key : null } - return children + println("relativeChildren.children: ${children}") + return children as List } void reset() { @@ -240,7 +238,6 @@ class QuiltPackage { Namespace namespace = packageNamespace() Manifest.Builder builder = Manifest.builder() Files.walk(packageDest()).filter(f -> Files.isRegularFile(f)).forEach(f -> { - println(f) String logicalKey = packageDest().relativize(f) LocalPhysicalKey physicalKey = new LocalPhysicalKey(f) long size = Files.size(f) 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 263f715d..f56472e9 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy @@ -22,6 +22,7 @@ import nextflow.quilt.nio.QuiltPath import spock.lang.Ignore import spock.lang.IgnoreIf +import spock.lang.Unroll import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -63,6 +64,25 @@ class QuiltPackageTest extends QuiltSpecification { pkg == pkg2 } + @Unroll + void 'should find relativeChildren of complete folders'() { + given: + Path path = Paths.get(new URI(PACKAGE_URL)) + when: + QuiltPackage pkg = path.pkg() + then: + pkg.relativeChildren(subpath).size() == expected_size + + where: + subpath | expected_size + '' | 8 + '.ipynb_checkpoints' | 1 + '/.ipynb_checkpoints' | 1 + '.ipynb' | 1 + '/.ipynb' | 0 + + } + void 'should distinguish Packages with same name in different Buckets '() { given: def url2 = TEST_URL.replace('quilt-', 'quilted-')