-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.test-bats.yaml
77 lines (71 loc) · 2.21 KB
/
docker-compose.test-bats.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This file is part of mettmail (https://github.com/spezifisch/mettmail).
# Copyright (c) 2022 spezifisch (https://github.com/spezifisch)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
services:
# test dovecot with imap/lmtp (our test source and destination server)
testcot:
image: ghcr.io/spezifisch/docker-test-dovecot:latest
volumes:
- testcot-home:/home
# wait until testcot's imaps port is reachable. used by the github test action
testcot_wait:
depends_on:
- testcot
image: busybox:1
environment:
TESTHOST: testcot
TESTPORT: 993
command:
[
"sh",
"-c",
"until nc -z $$TESTHOST $$TESTPORT; do echo waiting; sleep 1; done;
echo up"
]
# fetch from a -> deliver to rxa
mettmail_a:
depends_on:
- testcot
build:
context: .
image: mettmail-bats-test
volumes:
- ./tests/data/mettmail-a.yaml:/config/mettmail.yaml:ro
command: [ "--trace", "--config", "/config/mettmail.yaml" ]
restart: unless-stopped
# fetch from rxb -> deliver to rxc
mettmail_rxb:
depends_on:
- testcot
image: mettmail-bats-test
volumes:
- ./tests/data/mettmail-rxb.yaml:/config/mettmail.yaml:ro
command: [ "--trace", "--config", "/config/mettmail.yaml" ]
restart: unless-stopped
# test runner
test:
depends_on:
- testcot
- mettmail_a
- mettmail_rxb
image: ghcr.io/spezifisch/docker-bats-extra:latest
volumes:
# bats test scripts
- ./tests/bats:/code/tests:ro
# test users home dirs
- testcot-home:/home
# run all bats tests
command: "/code/tests"
volumes:
testcot-home: null