Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions tests/plugin/docker/docker-compose.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

version: '2.1'

services:
collector:
build:
context: .
dockerfile: Dockerfile.tool
ports:
- 19876:19876
- 12800:12800
networks:
- beyond
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/12800"]
interval: 5s
timeout: 60s
retries: 120

agent:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
SW_AGENT_LOGGING_LEVEL: DEBUG
networks:
- beyond
command: ['python3', '/entrypoint.py']
42 changes: 11 additions & 31 deletions tests/plugin/sw_http/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,18 @@ version: '2.1'

services:
collector:
build:
context: ../docker
dockerfile: Dockerfile.tool
ports:
- 19876:19876
- 12800:12800
networks:
- beyond
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/12800"]
interval: 5s
timeout: 60s
retries: 120
extends:
service: collector
file: ../docker/docker-compose.base.yml

provider:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9091:9091
volumes:
- ./services/provider.py:/app/provider.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/provider.py']
- ./services/provider.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand All @@ -56,18 +41,13 @@ services:
retries: 120

consumer:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9090:9090
volumes:
- ./services/consumer.py:/app/consumer.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/consumer.py']
- ./services/consumer.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_http/services/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'consumer'
config.logging_level = 'DEBUG'
agent.start()

import socketserver
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_http/services/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'provider'
config.logging_level = 'DEBUG'
agent.start()

import socketserver
Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/sw_http/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from tests.plugin import BasePluginTest


class TestRequestPlugin(BasePluginTest):
class TestPlugin(BasePluginTest):
@classmethod
def setUpClass(cls):
cls.compose = DockerCompose(filepath=dirname(abspath(__file__)))
Expand Down
42 changes: 11 additions & 31 deletions tests/plugin/sw_http_wsgi/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,18 @@ version: '2.1'

services:
collector:
build:
context: ../docker
dockerfile: Dockerfile.tool
ports:
- 19876:19876
- 12800:12800
networks:
- beyond
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/12800"]
interval: 5s
timeout: 60s
retries: 120
extends:
service: collector
file: ../docker/docker-compose.base.yml

provider:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9091:9091
volumes:
- ./services/provider.py:/app/provider.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/provider.py']
- ./services/provider.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand All @@ -56,18 +41,13 @@ services:
retries: 120

consumer:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9090:9090
volumes:
- ./services/consumer.py:/app/consumer.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/consumer.py']
- ./services/consumer.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_http_wsgi/services/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'consumer'
config.logging_level = 'DEBUG'
agent.start()

import socketserver
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_http_wsgi/services/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'provider'
config.logging_level = 'DEBUG'
agent.start()

from werkzeug import Request, Response
Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/sw_http_wsgi/test_http_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from tests.plugin import BasePluginTest


class TestRequestPlugin(BasePluginTest):
class TestPlugin(BasePluginTest):
@classmethod
def setUpClass(cls):
cls.compose = DockerCompose(filepath=dirname(abspath(__file__)))
Expand Down
42 changes: 11 additions & 31 deletions tests/plugin/sw_requests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,18 @@ version: '2.1'

services:
collector:
build:
context: ../docker
dockerfile: Dockerfile.tool
ports:
- 19876:19876
- 12800:12800
networks:
- beyond
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/12800"]
interval: 5s
timeout: 60s
retries: 120
extends:
service: collector
file: ../docker/docker-compose.base.yml

provider:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9091:9091
volumes:
- ./services/provider.py:/app/provider.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/provider.py']
- ./services/provider.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand All @@ -56,18 +41,13 @@ services:
retries: 120

consumer:
build:
context: ../../../
dockerfile: tests/plugin/docker/Dockerfile.agent
networks:
- beyond
extends:
service: agent
file: ../docker/docker-compose.base.yml
ports:
- 9090:9090
volumes:
- ./services/consumer.py:/app/consumer.py
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
command: ['python3', '/app/consumer.py']
- ./services/consumer.py:/entrypoint.py
depends_on:
collector:
condition: service_healthy
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_requests/services/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'consumer'
config.logging_level = 'DEBUG'
agent.start()

import socketserver
Expand Down
1 change: 0 additions & 1 deletion tests/plugin/sw_requests/services/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

if __name__ == '__main__':
config.service_name = 'provider'
config.logging_level = 'DEBUG'
agent.start()

import socketserver
Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/sw_requests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from tests.plugin import BasePluginTest


class TestRequestPlugin(BasePluginTest):
class TestPlugin(BasePluginTest):
@classmethod
def setUpClass(cls):
cls.compose = DockerCompose(filepath=dirname(abspath(__file__)))
Expand Down