-
Notifications
You must be signed in to change notification settings - Fork 7
104 lines (97 loc) · 3.52 KB
/
integration-test.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Integration tests
# TODO(ver) the integration test cases should not be enumerated in the workflow,
# but invoked via a general test runner.
on: [pull_request]
permissions:
contents: read
jobs:
docker-build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: linkerd/dev/actions/setup-tools@v44
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: target/buildx
key: buildx-${{ runner.os }}-${{ github.sha }}
restore-keys: buildx-${{ runner.os }}-
- run: just controller-build-image
--output type=docker
--tag 'ghcr.io/linkerd/failover:git-${{ github.sha }}'
--cache-from type=local,src=target/buildx
--cache-to type=local,dest=target/buildx
- run: just-dev prune-action-cache target/buildx
- run: mkdir -p /tmp/images
- run: docker save 'ghcr.io/linkerd/failover:git-${{ github.sha }}' --output /tmp/images/controller.tar
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: images
path: /tmp/images
install-test:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [docker-build]
steps:
- uses: linkerd/dev/actions/setup-tools@v44
- run: just-k3d create use
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: images
path: /tmp/images
- run: just-k3d import /tmp/images/controller.tar
- name: Install linkerd
run: |
curl -sL https://run.linkerd.io/install-edge | sh
export PATH=$PATH:~/.linkerd2/bin
linkerd install --crds | kubectl apply -f -
linkerd install --set proxy.enableShutdownEndpoint=true | kubectl apply -f -
linkerd check
- name: Install linkerd-smi
run: |
helm repo add linkerd-smi https://linkerd.github.io/linkerd-smi
helm repo up
helm install linkerd-smi -n linkerd-smi --create-namespace --wait linkerd-smi/linkerd-smi
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install current linkerd-failover
run: |
helm install linkerd-failover -n linkerd-failover --create-namespace --wait \
--set image.registry=ghcr.io/linkerd \
--set image.tag=git-${{ github.sha }} \
charts/linkerd-failover
- name: Test routing to primary
uses: ./.github/actions/failover-test
with:
westReplicas: 1
westShouldReceiveTraffic: true
centralReplicas: 1
centralShouldReceiveTraffic: false
eastReplicas: 1
eastShouldReceiveTraffic: false
- name: Test failover to secondaries
uses: ./.github/actions/failover-test
with:
westReplicas: 0
westShouldReceiveTraffic: false
centralReplicas: 1
centralShouldReceiveTraffic: true
eastReplicas: 1
eastShouldReceiveTraffic: true
- name: Test removal of one secondary
uses: ./.github/actions/failover-test
with:
westReplicas: 0
westShouldReceiveTraffic: false
centralReplicas: 0
centralShouldReceiveTraffic: false
eastReplicas: 1
eastShouldReceiveTraffic: true
- name: Test reestablishment of primary
uses: ./.github/actions/failover-test
with:
westReplicas: 1
westShouldReceiveTraffic: true
centralReplicas: 0
centralShouldReceiveTraffic: false
eastReplicas: 1
eastShouldReceiveTraffic: false