Skip to content

Commit bced582

Browse files
authored
[s3] add support for testing on macOS (tensorflow#1253)
* [s3] add support for testing on macOS * modify docker-compose cmd
1 parent 4b2f7e4 commit bced582

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

tests/test_aws/aws_test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
set -e
1818
set -o pipefail
1919

20-
LOCALSTACK_VERSION=0.12.2
21-
docker pull localstack/localstack:$LOCALSTACK_VERSION
22-
docker run -d --rm --net=host --name=tensorflow-io-aws localstack/localstack:$LOCALSTACK_VERSION
23-
echo "Waiting for 10 secs until localstack is up and running"
24-
sleep 10
20+
export LOCALSTACK_VERSION=0.12.2
21+
cd tests/test_aws
22+
TMPDIR=/private$TMPDIR docker-compose up -d
23+
cd -
24+
echo "Waiting for 20 secs until localstack is up and running"
25+
sleep 20
2526
echo "Localstack up"
2627
exit 0

tests/test_aws/docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '2.1'
2+
services:
3+
localstack:
4+
image: "localstack/localstack:${LOCALSTACK_VERSION}"
5+
container_name: tensorflow-io-aws
6+
ports:
7+
- "4566:4566"
8+
environment:
9+
- SERVICES=${SERVICES- }
10+
- DOCKER_HOST=unix:///var/run/docker.sock
11+
volumes:
12+
- "${TMPDIR:-/tmp/localstack}:/tmp/localstack"

tests/test_s3_eager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525

2626
@pytest.mark.skipif(
27-
sys.platform in ("win32", "darwin"),
28-
reason="TODO Localstack not setup properly on macOS/Windows yet",
27+
sys.platform in ("win32"),
28+
reason="TODO Localstack not setup properly on Windows yet",
2929
)
3030
def test_read_file():
3131
"""Test case for reading S3"""

0 commit comments

Comments
 (0)