Skip to content

Commit f3223bc

Browse files
committed
Add envtest required variables
1 parent 638f989 commit f3223bc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tasks_tools.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,5 @@ tasks:
186186
cmds:
187187
- 'GOBIN="{{.LOCALBIN}}" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@{{.ENVTEST_VERSION}}'
188188
- echo -n "{{.ENVTEST_VERSION}}" > {{.LOCALBIN}}/envtest_version
189+
- '{{.ROOT_DIR}}/bin/setup-envtest use {{.ENVTEST_K8S_VERSION}} -p path > {{.LOCALBIN}}/assets_path'
189190
internal: true

tasks_val.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ tasks:
2323
test:
2424
desc: " Run all tests."
2525
run: once
26+
vars:
27+
ENVTEST_K8S_VERSION: '{{ env "ENVTEST_K8S_VERSION" | default ( .ENVTEST_K8S_VERSION | default "1.30.0" ) }}'
28+
KUBEBUILDER_ASSETS:
29+
sh: '(test -f {{.LOCALBIN}}/assets_path && cat {{.LOCALBIN}}/assets_path) || echo ""'
2630
requires:
2731
vars:
2832
- CODE_DIRS
2933
deps:
3034
- test-envtest-dep
3135
cmds:
32-
- 'PROJECT_ROOT="{{.ROOT_DIR2}}" NESTED_MODULES="{{.NESTED_MODULES}}" {{.TASKFILE_DIR2}}/run-tests.sh {{.CODE_DIRS}}'
36+
- 'PROJECT_ROOT="{{.ROOT_DIR2}}" NESTED_MODULES="{{.NESTED_MODULES}}" KUBEBUILDER_ASSETS="{{.KUBEBUILDER_ASSETS}}" ENVTEST_K8S_VERSION="{{.ENVTEST_K8S_VERSION}}" {{.TASKFILE_DIR2}}/run-tests.sh {{.CODE_DIRS}}'
3337

3438
test-envtest-dep:
3539
desc: " Install the envtest dependency, if marked as required."

0 commit comments

Comments
 (0)