Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to bats-core for the e2e tests #338

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## In Development
* Switch to `bats-core` for the e2e tests.
mamercad marked this conversation as resolved.
Show resolved Hide resolved
* Temporary workaround for #311 to use previous bitnami index from: https://github.com/bitnami/charts/issues/10539 (#312 #318) (by @0xhaven)
* Refactor label definitions to be more consistent by building labels and label selectors in partial helper templates. (#299) (by @cognifloyd)
* Use the correct `apiVersion` for `Ingress` to add support for Kubernetes `v1.22`. (#301) (by @arms11)
Expand Down
29 changes: 22 additions & 7 deletions templates/tests/st2tests-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,28 @@ metadata:
spec:
initContainers:
# Sidecar container to copy BATS framework to the main container
- name: test-framework
image: dduportal/bats:latest
- name: bats-core
image: bats/bats:1.8.2
command:
- 'bash'
- '-ec'
- bash
- -ec
- |
cp -R /opt/bats/ ${BATS_HELPERS_DIR} /tools/
cp -R /opt/bats /tools/
volumeMounts:
- name: tools
mountPath: /tools
- name: bats-addons
image: alpine/git:2.36.3
command:
- ash
- -ec
- |
git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \
https://github.com/ztombol/bats-assert /tools/bats-assert
git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \
https://github.com/ztombol/bats-file /tools/bats-file
git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \
https://github.com/ztombol/bats-support /tools/bats-support
volumeMounts:
- name: tools
mountPath: /tools
Expand All @@ -31,7 +46,7 @@ spec:
name: {{ .Release.Name }}-st2-auth
env:
- name: BATS_HELPERS_DIR
value: /tools/bats-helpers/
value: /tools
- name: ST2_VERSION
value: "{{ .Chart.AppVersion }}"
- name: ST2_RBAC_ENABLED
Expand All @@ -42,7 +57,7 @@ spec:
- name: tests
mountPath: /tests
command:
- /tools/bats/libexec/bats
- /tools/bats/bin/bats
- /tests/st2tests.sh
volumes:
- name: tools
Expand Down