diff --git a/scripts/zarr_reader_open b/scripts/zarr_reader_open new file mode 100755 index 0000000..0072d7f --- /dev/null +++ b/scripts/zarr_reader_open @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e +set -u +set -x + +export INVOCATION_DIR=${INVOCATION_DIR:-$PWD} + +echo ======================= +echo Current Directory: $PWD +echo Invocation Directory: ${INVOCATION_DIR} +echo ======================= + +# 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 +} + +export BF_CP=${INVOCATION_DIR}/ZarrReader/target/\* +${INVOCATION_DIR}/bftools/showinf -format Zarr -nopix "$@"/.zattrs 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 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)