From cb267ee6958e398adc49ef4b9cff1962cdd61514 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 24 Dec 2024 22:45:04 -0500 Subject: [PATCH] Clean up tags in s3-tests Fix an off-by-one error in NIO.2 previously hidden by incorrect tags. --- .github/workflows/ci-main.yml | 3 +-- .../org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java | 2 +- src/test/resources/run-s3-tests.sh | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 0b64438..5d77d8a 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -95,7 +95,6 @@ jobs: run: | # TODO: run other test classes mvn test -Ds3proxy.test.conf=s3proxy-azurite.conf -Dtest=AwsSdkTest - # TODO: kill $(pidof node) - name: Install Minio run: | @@ -104,7 +103,6 @@ jobs: - name: Start Minio run: | mkdir mnt/ - # TODO: kill this afterwards MINIO_SERVER_URL=http://127.0.0.1:9000 MINIO_ROOT_USER=remote-identity MINIO_ROOT_PASSWORD=remote-credential ./minio server mnt/ & - name: Maven Test with Minio run: | @@ -125,6 +123,7 @@ jobs: - name: Run s3-tests with Azurite run: | ./src/test/resources/run-s3-tests.sh s3proxy-azurite.conf + kill $(pidof node) #Store the target - uses: actions/upload-artifact@v4 diff --git a/src/main/java/org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java b/src/main/java/org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java index a4c8be5..98b5c74 100644 --- a/src/main/java/org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java +++ b/src/main/java/org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java @@ -419,7 +419,7 @@ public abstract class AbstractNio2BlobStore extends BaseBlobStore { long offset = 0; long last = size; if (range.startsWith("-")) { - offset = last - Long.parseLong(range.substring(1)) + 1; + offset = last - Long.parseLong(range.substring(1)); if (offset < 0) { offset = 0; } diff --git a/src/test/resources/run-s3-tests.sh b/src/test/resources/run-s3-tests.sh index 421b14e..2ad99aa 100755 --- a/src/test/resources/run-s3-tests.sh +++ b/src/test/resources/run-s3-tests.sh @@ -38,8 +38,6 @@ tags='not fails_on_s3proxy'\ ' and not copy'\ ' and not cors'\ ' and not encryption'\ -' and not fails_on_s3proxy_azureblob'\ -' and not fails_on_s3proxy_nio2'\ ' and not fails_strict_rfc2616'\ ' and not iam_tenant'\ ' and not lifecycle'\ @@ -56,7 +54,10 @@ tags='not fails_on_s3proxy'\ ' and not webidentity_test' if [ "${S3PROXY_CONF}" = "s3proxy-azurite.conf" ]; then + tags="${tags} and not fails_on_s3proxy_azureblob" tags="${tags} and not multipart" +elif [ "${S3PROXY_CONF}" = "s3proxy-transient-nio2.conf" ]; then + tags="${tags} and not fails_on_s3proxy_nio2" fi # execute s3-tests