Skip to content

Commit

Permalink
[s3] add support for testing on macOS (tensorflow#1253)
Browse files Browse the repository at this point in the history
* [s3] add support for testing on macOS

* modify docker-compose cmd
  • Loading branch information
kvignesh1420 authored and i-ony committed Jan 22, 2021
1 parent d5fe4cb commit ebddbc2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
11 changes: 6 additions & 5 deletions tests/test_aws/aws_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions tests/test_aws/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions tests/test_s3_eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit ebddbc2

Please sign in to comment.