Skip to content

Commit 6b649cc

Browse files
committed
Switch to bats-core for the e2e tests
1 parent a795f5a commit 6b649cc

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## In Development
4+
* Switch to `bats-core` for the e2e tests.
45
* Temporary workaround for #311 to use previous bitnami index from: https://github.com/bitnami/charts/issues/10539 (#312 #318) (by @0xhaven)
56
* Refactor label definitions to be more consistent by building labels and label selectors in partial helper templates. (#299) (by @cognifloyd)
67
* Use the correct `apiVersion` for `Ingress` to add support for Kubernetes `v1.22`. (#301) (by @arms11)

templates/tests/st2tests-pod.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,28 @@ metadata:
99
spec:
1010
initContainers:
1111
# Sidecar container to copy BATS framework to the main container
12-
- name: test-framework
13-
image: dduportal/bats:latest
12+
- name: bats-core
13+
image: bats/bats:1.8.2
1414
command:
15-
- 'bash'
16-
- '-ec'
15+
- bash
16+
- -ec
1717
- |
18-
cp -R /opt/bats/ ${BATS_HELPERS_DIR} /tools/
18+
cp -R /opt/bats /tools/
19+
volumeMounts:
20+
- name: tools
21+
mountPath: /tools
22+
- name: bats-addons
23+
image: alpine/git:2.36.3
24+
command:
25+
- ash
26+
- -ec
27+
- |
28+
git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \
29+
https://github.com/ztombol/bats-assert /tools/bats-assert
30+
git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \
31+
https://github.com/ztombol/bats-file /tools/bats-file
32+
git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \
33+
https://github.com/ztombol/bats-support /tools/bats-support
1934
volumeMounts:
2035
- name: tools
2136
mountPath: /tools
@@ -31,7 +46,7 @@ spec:
3146
name: {{ .Release.Name }}-st2-auth
3247
env:
3348
- name: BATS_HELPERS_DIR
34-
value: /tools/bats-helpers/
49+
value: /tools
3550
- name: ST2_VERSION
3651
value: "{{ .Chart.AppVersion }}"
3752
- name: ST2_RBAC_ENABLED
@@ -42,7 +57,7 @@ spec:
4257
- name: tests
4358
mountPath: /tests
4459
command:
45-
- /tools/bats/libexec/bats
60+
- /tools/bats/bin/bats
4661
- /tests/st2tests.sh
4762
volumes:
4863
- name: tools

0 commit comments

Comments
 (0)