-
Notifications
You must be signed in to change notification settings - Fork 27
/
justfile
61 lines (44 loc) · 1.28 KB
/
justfile
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
export E2E_TEST := "default"
default:
@just --list
_helm-unittest:
helm plugin ls | grep unittest || helm plugin install https://github.com/helm-unittest/helm-unittest.git
# run helm unit tests
test-helm filter="*": _helm-unittest
helm unittest -f 'test/unit/{{filter}}.yaml' .
test: lint test-helm
# helm linter
lint-helm filter="*": _helm-unittest
helm unittest -f 'test/lint/{{filter}}.yaml' .
lint: lint-helm
_skaffold-ctx:
skaffold config set default-repo localhost:5000
# (re) create local k8s cluster using k3d
k3d: _chk-py && _skaffold-ctx
#!/usr/bin/env bash
set -euxo pipefail
k3d cluster rm cmak-operator || true
k3d cluster create --config ./test/e2e/k3d.yaml
source .venv/bin/activate
pytest --capture=tee-sys -p no:warnings test/e2e/traefik.py
# install into local k8s
up: _skaffold-ctx down
skaffold run
# remove from local k8s
down:
skaffold delete || true
_chk-py:
#!/usr/bin/env bash
set -euxo pipefail
if [ ! -d .venv ]; then
python3 -mvenv .venv
pip3 install -r test/e2e/requirements.txt
fi
# run only e2e test script
test-e2e-sh: _chk-py
#!/usr/bin/env bash
set -euxo pipefail
source .venv/bin/activate
pytest --capture=tee-sys -p no:warnings test/e2e/{{E2E_TEST}}/test.py
# run single e2e test
test-e2e: up test-e2e-sh