-
Notifications
You must be signed in to change notification settings - Fork 132
/
docker-compose.test.yaml
43 lines (41 loc) · 1.53 KB
/
docker-compose.test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
version: "3.9"
services:
toxiproxy:
image: ghcr.io/shopify/toxiproxy:2.11.0
hostname: toxiproxy
unit_test:
# The tests might require permissions to write to coverage out files.
# If you encounter issues with permissions, you can try running the container as root.
user: root
image: cimg/go:1.22.5
working_dir: /etc/ocpp-go
volumes:
- .:/etc/ocpp-go:rw
command:
- /bin/bash
- -c
- |
go test -v -covermode=count -coverprofile=coverage.out ./ocppj
go test -v -covermode=count -coverprofile=ocpp16.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp1.6/... github.com/lorenzodonini/ocpp-go/ocpp1.6_test
go test -v -covermode=count -coverprofile=ocpp201.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0.1/... github.com/lorenzodonini/ocpp-go/ocpp2.0.1_test
sed '1d;$d' ocpp16.out >> coverage.out
sed '1d;$d' ocpp201.out >> coverage.out
integration_test:
image: cimg/go:1.22.5
# The tests might require permissions to write to coverage out files.
# If you encounter issues with permissions, you can try running the container as root.
user: root
working_dir: /etc/ocpp-go
environment:
- TOXIPROXY_HOST=toxiproxy
- TOXIPROXY_PORT=8474
- PROXY_OCPP_LISTENER=toxiproxy:8886
- PROXY_OCPP_UPSTREAM=integration_test:8887
depends_on:
- toxiproxy
command:
- /bin/bash
- -c
- go test ./ws -v -covermode=count -coverprofile=integration_coverage.out
volumes:
- .:/etc/ocpp-go:rw