-
Notifications
You must be signed in to change notification settings - Fork 132
189 lines (157 loc) · 5 KB
/
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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Code build and checks
on:
push:
branches: [main]
paths-ignore: "docs/**"
pull_request:
paths-ignore: "docs/**"
branches: [main]
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# setup-go@v4 handles Go cache by default
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Setup gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Unit Test
id: unit_test
run: gotestsum --format pkgname --junitfile unit-tests.xml --jsonfile unit-tests.json -- -coverprofile=coverage.out -covermode=atomic ./...
- name: Unit Test Summary
if: always()
uses: test-summary/action@v2
with:
paths: |
unit-tests.xml
- name: Annotate Unit Tests
if: always()
uses: guyarb/golang-test-annotations@v0.8.0
with:
test-results: unit-tests.json
- name: Upload code coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-coverage
path: coverage.out
if-no-files-found: error
retention-days: 1
- name: Send coverage report to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
file: ./coverage.out
flags: unittests
name: codecov-testkube-unit-tests
verbose: true
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
mongo:
image: bitnami/mongodb
ports:
- 27017:27017
nats:
image: bitnami/nats
ports:
- 4222:4222
- 6222:6222
- 8222:8222
minio:
image: bitnami/minio
ports:
- 9000:9000
- 9001:9001
env:
MINIO_ROOT_USER: minio99
MINIO_ROOT_PASSWORD: minio123
steps:
- uses: actions/checkout@v4
# setup-go@v4 handles Go cache by default
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Set up Java@11
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "11"
- name: Install node@19
uses: actions/setup-node@v4
with:
node-version: 19
- name: Install pnpm@8.1
uses: pnpm/action-setup@v4
with:
version: 8.1.0
- name: Install Artillery@2.0
run: npm install -g artillery@2.0.0-31
- name: Install kubepug@1.7.1
uses: cpanato/kubepug-installer@v1.2.0
with:
kubepug-release: "1.7.1"
- name: Install k6
run: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
- name: Set up JMeter@5.6.3
run: |
wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.zip
unzip apache-jmeter-5.6.3.zip
mv apache-jmeter-5.6.3 jmeter
sudo mv jmeter /opt
echo "/opt/jmeter/bin" >> $GITHUB_PATH
- name: Set up Newman@5.3
run: |
npm install -g newman@5.3.2
- name: Install Ginkgo@2.9
run: go install github.com/onsi/ginkgo/v2/ginkgo@v2.9.2
- name: Set up gotestsum@v1.9
run: go install gotest.tools/gotestsum@v1.9.0
- name: Set up Playwright
run: pnpx playwright install --with-deps
- name: Set up Tracetest
run: curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash
- name: Set up git
run: sudo apt-get install -y git
- name: Integration Tests
env:
STORAGE_ACCESSKEYID: minio99
STORAGE_SECRETACCESSKEY: minio123
run: INTEGRATION=y gotestsum --format pkgname --junitfile integration-tests.xml --jsonfile integration-tests.json -- -run _Integration -coverprofile=coverage.out -covermode=atomic ./...
- name: Integration Test Summary
if: always()
uses: test-summary/action@v2
with:
paths: |
integration-tests.xml
- name: Annotate Integration Tests
if: always()
uses: guyarb/golang-test-annotations@v0.8.0
with:
test-results: integration-tests.json
- name: Upload code coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage
path: coverage.out
if-no-files-found: error
retention-days: 1
- name: Send coverage report to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
file: ./coverage.out
flags: integrationtests
name: codecov-testkube-integration-tests
verbose: true