Skip to content

Commit 902192d

Browse files
committed
add testing profile to docker compose
1 parent fe3e94f commit 902192d

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

docker-compose.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,50 @@ services:
1515
watch:
1616
- path: ./cpanfile
1717
action: rebuild
18+
19+
api-test:
20+
profiles:
21+
- test
22+
depends_on:
23+
elasticsearch-test:
24+
condition: service_healthy
25+
build:
26+
context: .
27+
target: test
28+
environment:
29+
NET_ASYNC_HTTP_MAXCONNS: 1
30+
COLUMNS: 80
31+
ES: http://elasticsearch-test:9200
32+
HARNESS_ACTIVE: 1
33+
# Instantiate Catalyst models using metacpan_server_testing.conf
34+
METACPAN_SERVER_CONFIG_LOCAL_SUFFIX: testing
35+
MINICPAN: /CPAN
36+
DEVEL_COVER_OPTIONS: +ignore,^t/|^test-data/|^etc/|^local/
37+
networks:
38+
- elasticsearch
39+
volumes:
40+
- type: volume
41+
source: elasticsearch-test
42+
target: /usr/share/elasticsearch/data
43+
44+
elasticsearch-test:
45+
profiles:
46+
- test
47+
platform: linux/amd64
48+
image: elasticsearch:2.4
49+
environment:
50+
- discovery.type=single-node
51+
healthcheck:
52+
timeout: 5s
53+
start_period: 60s
54+
test: ["CMD", "curl", "--fail", "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s"]
55+
ports:
56+
- "9200"
57+
networks:
58+
- elasticsearch
59+
60+
networks:
61+
elasticsearch:
62+
63+
volumes:
64+
elasticsearch-test:

metacpan_server_testing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source_base: var/t/tmp/source
88

99
elasticsearch_servers:
1010
client: '2_0::Direct'
11-
nodes: http://elasticsearch_test:9200
11+
nodes: ${ES:-http://elasticsearch_test:9200}
1212

1313
minion_dsn: "postgresql://metacpan:t00lchain@pghost:5432/minion_queue"
1414

0 commit comments

Comments
 (0)