summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/linux.yml4
-rwxr-xr-xMakefile12
-rw-r--r--tests/Dockerfile0
-rw-r--r--tests/docker-compose.yaml15
-rw-r--r--tests/env/Dockerfile-elastic-mq.yaml9
-rw-r--r--tests/env/custom.conf8
-rw-r--r--tests/env/docker-compose-jobs.yml (renamed from tests/docker-compose-jobs.yml)0
-rw-r--r--tests/env/docker-compose.yaml37
8 files changed, 62 insertions, 23 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 4679cc24..1d56e8a9 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -66,7 +66,7 @@ jobs:
- name: Run golang tests on Linux
run: |
- docker-compose -f ./tests/docker-compose.yaml up -d
+ docker-compose -f ./tests/env/docker-compose.yaml up -d
mkdir ./coverage-ci
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/pipe.txt -covermode=atomic ./pkg/transport/pipe
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/socket.txt -covermode=atomic ./pkg/transport/socket
@@ -97,7 +97,7 @@ jobs:
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/broadcast_plugin.txt -covermode=atomic ./tests/plugins/broadcast
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/websockets.txt -covermode=atomic ./tests/plugins/websockets
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/ws_origin.txt -covermode=atomic ./plugins/websockets
- docker-compose -f ./tests/docker-compose.yaml down
+ docker-compose -f ./tests/env/docker-compose.yaml down
cat ./coverage-ci/*.txt > ./coverage-ci/summary.txt
- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
diff --git a/Makefile b/Makefile
index 625c6788..f02f8e2a 100755
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
SHELL = /bin/sh
test_coverage:
- docker-compose -f tests/docker-compose.yaml up -d --remove-orphans
+ docker-compose -f tests/env/docker-compose.yaml up -d --remove-orphans
rm -rf coverage
mkdir coverage
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/pipe.out -covermode=atomic ./pkg/transport/pipe
@@ -38,10 +38,10 @@ test_coverage:
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/ws_plugin.out -covermode=atomic ./tests/plugins/websockets
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/ws_origin.out -covermode=atomic ./plugins/websockets
cat ./coverage/*.out > ./coverage/summary.out
- docker-compose -f tests/docker-compose.yaml down
+ docker-compose -f tests/env/docker-compose.yaml down
test: ## Run application tests
- docker-compose -f tests/docker-compose.yaml up -d
+ docker-compose -f tests/env/docker-compose.yaml up -d
go test -v -race -tags=debug ./pkg/transport/pipe
go test -v -race -tags=debug ./pkg/transport/socket
go test -v -race -tags=debug ./pkg/pool
@@ -71,10 +71,10 @@ test: ## Run application tests
go test -v -race -tags=debug ./tests/plugins/broadcast
go test -v -race -tags=debug ./tests/plugins/websockets
go test -v -race -tags=debug ./plugins/websockets
- docker-compose -f tests/docker-compose.yaml down
+ docker-compose -f tests/env/docker-compose.yaml down
testGo1.17beta1: ## Run application tests
- docker-compose -f tests/docker-compose.yaml up -d
+ docker-compose -f tests/env/docker-compose.yaml up -d
go1.17beta1 test -v -race -tags=debug ./pkg/transport/pipe
go1.17beta1 test -v -race -tags=debug ./pkg/transport/socket
go1.17beta1 test -v -race -tags=debug ./pkg/pool
@@ -102,4 +102,4 @@ testGo1.17beta1: ## Run application tests
go1.17beta1 test -v -race -tags=debug ./tests/plugins/websockets
go1.17beta1 test -v -race -tags=debug ./tests/plugins/broadcast
go1.17beta1 test -v -race -tags=debug ./plugins/websockets
- docker-compose -f tests/docker-compose.yaml down
+ docker-compose -f tests/env/docker-compose.yaml down
diff --git a/tests/Dockerfile b/tests/Dockerfile
deleted file mode 100644
index e69de29b..00000000
--- a/tests/Dockerfile
+++ /dev/null
diff --git a/tests/docker-compose.yaml b/tests/docker-compose.yaml
deleted file mode 100644
index b6ba0f66..00000000
--- a/tests/docker-compose.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-version: '3'
-
-services:
- memcached:
- image: memcached:latest
- ports:
- - "0.0.0.0:11211:11211"
- redis:
- image: redis:6
- ports:
- - "6379:6379"
- redis2:
- image: redis:6
- ports:
- - "6378:6379"
diff --git a/tests/env/Dockerfile-elastic-mq.yaml b/tests/env/Dockerfile-elastic-mq.yaml
new file mode 100644
index 00000000..c9f909d0
--- /dev/null
+++ b/tests/env/Dockerfile-elastic-mq.yaml
@@ -0,0 +1,9 @@
+FROM openjdk:16
+
+ADD https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-1.1.1.jar /
+COPY custom.conf /
+ENTRYPOINT ["java", "-Dconfig.file=custom.conf", "-jar", "/elasticmq-server-1.1.1.jar"]
+
+EXPOSE 9324
+
+CMD ["-help"]
diff --git a/tests/env/custom.conf b/tests/env/custom.conf
new file mode 100644
index 00000000..9be7730e
--- /dev/null
+++ b/tests/env/custom.conf
@@ -0,0 +1,8 @@
+include classpath("application.conf")
+
+node-address {
+ protocol = http
+ host = "*"
+ port = 9324
+ context-path = ""
+}
diff --git a/tests/docker-compose-jobs.yml b/tests/env/docker-compose-jobs.yml
index 7b88c9cf..7b88c9cf 100644
--- a/tests/docker-compose-jobs.yml
+++ b/tests/env/docker-compose-jobs.yml
diff --git a/tests/env/docker-compose.yaml b/tests/env/docker-compose.yaml
new file mode 100644
index 00000000..a407fed4
--- /dev/null
+++ b/tests/env/docker-compose.yaml
@@ -0,0 +1,37 @@
+version: '3'
+
+services:
+ memcached:
+ image: memcached:latest
+ ports:
+ - "0.0.0.0:11211:11211"
+ redis:
+ image: redis:6
+ ports:
+ - "6379:6379"
+ redis2:
+ image: redis:6
+ ports:
+ - "6378:6379"
+
+ beanstalk:
+ image: schickling/beanstalkd
+ ports:
+ - "11300:11300"
+
+ sqs:
+ build:
+ context: .
+ dockerfile: Dockerfile-elastic-mq.yaml
+ ports:
+ - "9324:9324"
+
+ rabbitmq:
+ image: rabbitmq:3-management
+ environment:
+ RABBITMQ_DEFAULT_USER: guest
+ RABBITMQ_DEFAULT_PASS: guest
+ RABBITMQ_DEFAULT_VHOST: /
+ ports:
+ - "15672:15672"
+ - "5672:5672"