From 14ff471f06dfa7ac3fbde09f7642010129c89754 Mon Sep 17 00:00:00 2001 From: jmoore Date: Fri, 17 Sep 2021 09:31:47 +0200 Subject: [PATCH 1/3] Enable ZarrReader tests This script downloads the latest bftools.zip script, checks out the latest ZarrReader code, builds it, and launches the two together against each of the sources defined. --- scripts/zarr_reader_open | 15 +++++++++++++++ suites.yml | 3 +++ 2 files changed, 18 insertions(+) create mode 100755 scripts/zarr_reader_open diff --git a/scripts/zarr_reader_open b/scripts/zarr_reader_open new file mode 100755 index 0000000..1fde92f --- /dev/null +++ b/scripts/zarr_reader_open @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -e +set -u + + +test -e bftools || { + test -e bftools.zip || wget https://downloads.openmicroscopy.org/bio-formats/latest/artifacts/bftools.zip + unzip bftools +} + +test -e ZarrReader || git clone git://github.com/ome/ZarrReader 1>&2 +cd ZarrReader +mvn package -DskipTests # 1>&2 +cd .. +env BF_CP=ZarrReader/target/*.jar bftools/showinf -nopix "$@" diff --git a/suites.yml b/suites.yml index 1079cdc..666e18d 100644 --- a/suites.yml +++ b/suites.yml @@ -7,3 +7,6 @@ - name: checksum script: zarr_checksum + +- name: reader + script: zarr_reader_open From 2d4d55e5d1150ddee2a5c479d4bf204c71bb711d Mon Sep 17 00:00:00 2001 From: jmoore Date: Sun, 19 Sep 2021 17:19:26 +0200 Subject: [PATCH 2/3] Passing zarr_reader_open * append `.zattrs` to all .zarr arguments * define INVOCATION_DIR to speed up tests --- scripts/zarr_reader_open | 27 +++++++++++++++++++++------ test_suite.py | 4 +++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/scripts/zarr_reader_open b/scripts/zarr_reader_open index 1fde92f..4f8190b 100755 --- a/scripts/zarr_reader_open +++ b/scripts/zarr_reader_open @@ -1,15 +1,30 @@ #!/usr/bin/env bash + set -e set -u +set -x + +echo ======================= +echo Current Directory: $PWD +echo Invocation Directory: ${INVOCATION_DIR} +echo ======================= -test -e bftools || { +# Install bftools if missing +test -e ${INVOCATION_DIR}/bftools || { + pushd ${INVOCATION_DIR} test -e bftools.zip || wget https://downloads.openmicroscopy.org/bio-formats/latest/artifacts/bftools.zip unzip bftools + popd +} + +# Build ZarrReader if not built +test -e ${INVOCATION_DIR}/ZarrReader || { + git clone git://github.com/ome/ZarrReader ${INVOCATION_DIR}/ZarrReader + pushd ${INVOCATION_DIR}ZarrReader + mvn package -DskipTests # 1>&2 + popd } -test -e ZarrReader || git clone git://github.com/ome/ZarrReader 1>&2 -cd ZarrReader -mvn package -DskipTests # 1>&2 -cd .. -env BF_CP=ZarrReader/target/*.jar bftools/showinf -nopix "$@" +export BF_CP=${INVOCATION_DIR}/ZarrReader/target/\* +${INVOCATION_DIR}/bftools/showinf -nopix "$@"/.zattrs diff --git a/test_suite.py b/test_suite.py index b5ebb8f..9d3fcbf 100644 --- a/test_suite.py +++ b/test_suite.py @@ -180,7 +180,9 @@ def source(request: SubRequest, tmpdir: py.path.local) -> typing.Iterator[Source def suite(request: SubRequest, tmpdir: os.PathLike) -> typing.Iterator[Suite]: doc = request.param script = doc["script"] - script = f"{request.config.invocation_dir}/scripts/{script}" + idir = f"{request.config.invocation_dir}" + os.environ["INVOCATION_DIR"] = idir + script = f"{idir}/scripts/{script}" yield Suite(script) From 7ed18c764d9cc86dc42030783bedbf9ff06845a5 Mon Sep 17 00:00:00 2001 From: jmoore Date: Sun, 19 Sep 2021 18:13:09 +0200 Subject: [PATCH 3/3] Set format to prevent long searches over HTTP --- scripts/zarr_reader_open | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/zarr_reader_open b/scripts/zarr_reader_open index 4f8190b..0072d7f 100755 --- a/scripts/zarr_reader_open +++ b/scripts/zarr_reader_open @@ -4,6 +4,7 @@ set -e set -u set -x +export INVOCATION_DIR=${INVOCATION_DIR:-$PWD} echo ======================= echo Current Directory: $PWD @@ -27,4 +28,4 @@ test -e ${INVOCATION_DIR}/ZarrReader || { } export BF_CP=${INVOCATION_DIR}/ZarrReader/target/\* -${INVOCATION_DIR}/bftools/showinf -nopix "$@"/.zattrs +${INVOCATION_DIR}/bftools/showinf -format Zarr -nopix "$@"/.zattrs