Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit a474784

Browse files
committed
Factor out wait for exporter function
1 parent 4671491 commit a474784

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tests.bats

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
setup() {
22
bats_load_library bats-support
33
bats_load_library bats-assert
4+
5+
bats_require_minimum_version 1.5.0
6+
}
7+
8+
wait_for_exporter() {
9+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
10+
exporters.jumpstarter.dev/test-exporter-oidc
11+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
12+
exporters.jumpstarter.dev/test-exporter-sa
13+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
14+
exporters.jumpstarter.dev/test-exporter-legacy
415
}
516

617
@test "can create clients with admin cli" {
@@ -78,17 +89,12 @@ while true; do
7889
done
7990
EOF
8091

81-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
82-
exporters.jumpstarter.dev/test-exporter-oidc
83-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
84-
exporters.jumpstarter.dev/test-exporter-sa
85-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
86-
exporters.jumpstarter.dev/test-exporter-legacy
92+
93+
wait_for_exporter
8794
}
8895

8996
@test "can specify client config only using environment variables" {
90-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
91-
exporters.jumpstarter.dev/test-exporter-oidc
97+
wait_for_exporter
9298

9399
JMP_NAMEPSACE=default \
94100
JMP_NAME=test-exporter-legacy \
@@ -98,8 +104,7 @@ EOF
98104
}
99105

100106
@test "can operate on leases" {
101-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
102-
exporters.jumpstarter.dev/test-exporter-oidc
107+
wait_for_exporter
103108

104109
jmp config client use test-client-oidc
105110

@@ -110,12 +115,7 @@ EOF
110115
}
111116

112117
@test "can lease and connect to exporters" {
113-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
114-
exporters.jumpstarter.dev/test-exporter-oidc
115-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
116-
exporters.jumpstarter.dev/test-exporter-sa
117-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
118-
exporters.jumpstarter.dev/test-exporter-legacy
118+
wait_for_exporter
119119

120120
jmp shell --client test-client-oidc --selector example.com/board=oidc j power on
121121
jmp shell --client test-client-sa --selector example.com/board=sa j power on

0 commit comments

Comments
 (0)