Skip to content

Commit c4495ee

Browse files
committed
Update templated files to rev fa98fee (#307)
Automatically created PR based on commit fa98fee1a8e172a2c7ff2300ca7c461692a8bc1c in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: fhennig with message [This is for using beku instead of ansible for the test generation]
1 parent ca90f83 commit c4495ee

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
tests/ansible/roles/
21
tests/_work/
32
debug/
43
target/

scripts/run_tests.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
#!/usr/bin/env bash
2-
set -e
3-
4-
# Register absolute paths to pass to Ansible so the location of the role is irrelevant
5-
# for the run
6-
TESTDIR="$(pwd)/tests"
7-
WORKDIR="$(pwd)/tests/_work"
8-
9-
# Create dirs
10-
mkdir -p tests/ansible/roles
11-
mkdir -p "$WORKDIR"
122

13-
# Install Ansible role if needed
14-
pushd tests/ansible
15-
ansible-galaxy role install -r requirements.yaml -p ./roles
3+
# Check if the test expansion tool beku is installed
4+
set +e
5+
which beku > /dev/null 2>&1
6+
beku_installed=$?
7+
set -e
8+
if [ $beku_installed -ne 0 ]; then
9+
echo "Please install beku.py to run the tests, see https://github.com/stackabletech/beku.py"
10+
exit 1
11+
fi
1612

17-
# TODO: create pipenv in files for script thingy
13+
echo "Using beku version: $(beku --version)"
1814

19-
# Funnel via JSON to ensure that values are escaped properly
20-
echo '{}' | jq '{work_dir: $WORKDIR, test_dir: $TESTDIR}' --arg WORKDIR "$WORKDIR" --arg TESTDIR "$TESTDIR" > "${WORKDIR}"/vars.json
15+
# cleanup any old tests
16+
rm -rf tests/_work
2117

22-
# Run playbook to generate test scenarios
23-
ansible-playbook playbook.yaml --extra-vars "@${WORKDIR}/vars.json"
24-
popd
18+
# Expand the tests
19+
beku
2520

26-
# Run tests
21+
# Run tests, pass the params
2722
pushd tests/_work
2823
kubectl kuttl test "$@"
2924
popd

tests/README-templating.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ To run tests locally you need the following things installed:
7171

7272
- python3 (version >= 3.9)
7373
- pyyaml library installed
74-
- ansible (tested with `2.10.8` and `2.12.5`)
7574
- jq
7675

7776
### Running
@@ -80,4 +79,4 @@ To run tests please execute the following command from the gitroot of the operat
8079

8180
`scripts/run_tests.sh --parallel 2`
8281

83-
This will install the necessary ansible role into `tests/ansible/roles`, expand the test templates into all defined test scenarios and execute kuttl to test these scenarios. Any arguments are passed on to `kuttl`.
82+
This will expand the test templates into all defined test scenarios and execute kuttl to test these scenarios. Any arguments are passed on to `kuttl`.

0 commit comments

Comments
 (0)