From 81789bde99e62523ca4d9f460bb345c666902acd Mon Sep 17 00:00:00 2001 From: Vignesh Kothapalli Date: Mon, 4 Jan 2021 21:23:23 +0530 Subject: [PATCH] [s3] add support for testing on macOS (#1253) * [s3] add support for testing on macOS * modify docker-compose cmd --- tests/test_aws/aws_test.sh | 11 ++++++----- tests/test_aws/docker-compose.yml | 12 ++++++++++++ tests/test_s3_eager.py | 4 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 tests/test_aws/docker-compose.yml diff --git a/tests/test_aws/aws_test.sh b/tests/test_aws/aws_test.sh index a4778a48e..1d21494bc 100755 --- a/tests/test_aws/aws_test.sh +++ b/tests/test_aws/aws_test.sh @@ -17,10 +17,11 @@ set -e set -o pipefail -LOCALSTACK_VERSION=0.12.2 -docker pull localstack/localstack:$LOCALSTACK_VERSION -docker run -d --rm --net=host --name=tensorflow-io-aws localstack/localstack:$LOCALSTACK_VERSION -echo "Waiting for 10 secs until localstack is up and running" -sleep 10 +export LOCALSTACK_VERSION=0.12.2 +cd tests/test_aws +TMPDIR=/private$TMPDIR docker-compose up -d +cd - +echo "Waiting for 20 secs until localstack is up and running" +sleep 20 echo "Localstack up" exit 0 diff --git a/tests/test_aws/docker-compose.yml b/tests/test_aws/docker-compose.yml new file mode 100644 index 000000000..3877f5637 --- /dev/null +++ b/tests/test_aws/docker-compose.yml @@ -0,0 +1,12 @@ +version: '2.1' +services: + localstack: + image: "localstack/localstack:${LOCALSTACK_VERSION}" + container_name: tensorflow-io-aws + ports: + - "4566:4566" + environment: + - SERVICES=${SERVICES- } + - DOCKER_HOST=unix:///var/run/docker.sock + volumes: + - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" \ No newline at end of file diff --git a/tests/test_s3_eager.py b/tests/test_s3_eager.py index ad18af1f7..dc8e3ff0c 100644 --- a/tests/test_s3_eager.py +++ b/tests/test_s3_eager.py @@ -24,8 +24,8 @@ @pytest.mark.skipif( - sys.platform in ("win32", "darwin"), - reason="TODO Localstack not setup properly on macOS/Windows yet", + sys.platform in ("win32"), + reason="TODO Localstack not setup properly on Windows yet", ) def test_read_file(): """Test case for reading S3"""