Skip to content

Commit a8cd6ae

Browse files
authored
fixed generic docker-compose (#361)
1 parent e8011e5 commit a8cd6ae

2 files changed

Lines changed: 27 additions & 29 deletions

File tree

docker-compose.yml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,29 @@
22
# run it with:
33
# docker-compose up --exit-code-from testrunner
44

5-
sdk_test_server:
6-
image: sdk_test_server
7-
#build: .
8-
environment:
9-
- MBED_CLOUD_SDK_API_KEY=abc123
10-
- CI=yes
11-
- TEST_RUNNER_DEFAULT_API_KEY
12-
- TEST_RUNNER_DEFAULT_API_HOST
13-
volumes:
14-
- ../results:/build/results
15-
- ../test_fixtures:/test_fixtures
16-
command: [sh, -c, 'source .venv/bin/activate && pytest tests/unit tests/integration']
17-
testrunner:
18-
#build: tests/mbed-cloud-sdk-testrunner
19-
image: ${TESTRUNNER_DOCKER_IMAGE}
20-
environment:
21-
- TEST_SERVER_URL=http://sdk_test_server:5000
22-
#folder on test server to get test files from
23-
- TEST_FIXTURES_DIR=/test_fixtures
24-
- TEST_RUNNER_SHUTDOWN_SERVER=yes
25-
- TEST_RUNNER_DEFAULT_API_KEY
26-
- TEST_RUNNER_DEFAULT_API_HOST
27-
links:
28-
- sdk_test_server
29-
volumes:
30-
- ../results:/runner/results
31-
- ../test_fixtures:/runner/test_fixtures
32-
# sleep ensures the testrunner stays up whilst test server completes coverage shutdown
33-
command: [sh, -c, '(python -m trunner || true) && sleep 10000']
5+
sdk_test_server:
6+
command:
7+
- sh
8+
- "-c"
9+
- "source .venv/bin/activate && python tests/integration/server.py"
10+
environment:
11+
- MBED_CLOUD_SDK_API_KEY=abc123
12+
- TEST_RUNNER_DEFAULT_API_KEY
13+
- TEST_RUNNER_DEFAULT_API_HOST
14+
image: sdk_test_server
15+
volumes: ["../results:/build/results", "../test_fixtures:/test_fixtures"]
16+
testrunner:
17+
environment:
18+
- "TEST_SERVER_URL=http://sdk_test_server:5000"
19+
- TEST_FIXTURES_DIR=/test_fixtures
20+
- TEST_RUNNER_DEFAULT_API_KEY
21+
- TEST_RUNNER_DEFAULT_API_HOST
22+
image: "${TESTRUNNER_DOCKER_IMAGE}"
23+
command:
24+
- sh
25+
- "-c"
26+
- "sleep 1 && python -m trunner"
27+
links:
28+
- sdk_test_server
29+
volumes: ["../results:/runner/results", "../test_fixtures:/runner/test_fixtures"]
30+

docs/news/14062019.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Created a generic docker-compose file to run integration tests

0 commit comments

Comments
 (0)