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

Commit 99cd881

Browse files
committed
Support running e2e on macOS
1 parent 4671491 commit 99cd881

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

.github/workflows/selftest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
os:
99
- ubuntu-24.04
1010
- ubuntu-24.04-arm
11+
- macos-13 # arm-based macOS runners does not support nested virt
1112
runs-on: ${{ matrix.os }}
1213
steps:
1314
- uses: actions/checkout@v4

action.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ runs:
1515
shell: bash
1616
run: |
1717
uv python install 3.12
18-
- name: Install bats
18+
- name: Install bats (Linux)
1919
shell: bash
20+
if: runner.os == 'Linux'
2021
run: |
2122
sudo apt-get update
2223
sudo apt-get install -y bats bats-support bats-assert
24+
- name: Install bats (macOS)
25+
shell: bash
26+
if: runner.os == 'macOS'
27+
run: |
28+
brew install bats-core bat-extras
2329
- name: Checkout jumpstarter controller
2430
uses: actions/checkout@v4
2531
with:
@@ -32,6 +38,12 @@ runs:
3238
repository: jumpstarter-dev/jumpstarter
3339
ref: ${{ inputs.jumpstarter-ref }}
3440
path: jumpstarter
41+
- name: Install Docker and Kind (macOS)
42+
if: runner.os == 'macOS'
43+
shell: bash
44+
run: |
45+
brew install colima docker kind go kubectl helm gnu-sed
46+
colima start --network-address --cpu 4 --memory 8 --mount-type virtiofs
3547
- name: Deploy dex
3648
shell: bash
3749
run: |
@@ -59,12 +71,20 @@ runs:
5971
--group=system:unauthenticated
6072
6173
helm repo add dex https://charts.dexidp.io
62-
helm install --namespace dex --wait -f "$GITHUB_ACTION_PATH"/dex.values.yaml dex dex/dex
74+
helm install --namespace dex --wait --timeout 20m -f "$GITHUB_ACTION_PATH"/dex.values.yaml dex dex/dex
75+
76+
if [[ "$(uname)" == "Darwin" ]]; then
77+
echo "192.168.65.2 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts
78+
gsed -i 's|$("${SCRIPT_DIR}"/get_ext_ip.sh)|192.168.65.2|' ./controller/hack/deploy_with_helm.sh
79+
gsed -i 's|RETRIES=60|RETRIES=600|' ./controller/hack/deploy_with_helm.sh
6380
64-
sudo cp ca.pem /usr/local/share/ca-certificates/dex.crt
65-
sudo update-ca-certificates
81+
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.pem
82+
else
83+
echo "127.0.0.1 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts
6684
67-
echo "127.0.0.1 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts
85+
sudo cp ca.pem /usr/local/share/ca-certificates/dex.crt
86+
sudo update-ca-certificates
87+
fi
6888
- name: Deploy jumpstarter controller
6989
shell: bash
7090
run: |
@@ -90,6 +110,7 @@ runs:
90110
. .venv/bin/activate
91111
92112
export JUMPSTARTER_GRPC_INSECURE=1
113+
export JUMPSTARTER_FORCE_SYSTEM_CERTS=1
93114
94115
kubectl create -n default sa test-client-sa
95116
kubectl create -n default sa test-exporter-sa

tests.bats

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ setup() {
33
bats_load_library bats-assert
44
}
55

6+
wait_for_exporter() {
7+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
8+
exporters.jumpstarter.dev/test-exporter-oidc
9+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
10+
exporters.jumpstarter.dev/test-exporter-sa
11+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
12+
exporters.jumpstarter.dev/test-exporter-legacy
13+
}
14+
615
@test "can create clients with admin cli" {
716
jmp admin create client test-client-oidc --unsafe --out /dev/null \
817
--oidc-username dex:test-client-oidc
@@ -78,17 +87,11 @@ while true; do
7887
done
7988
EOF
8089

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
90+
wait_for_exporter
8791
}
8892

8993
@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
94+
wait_for_exporter
9295

9396
JMP_NAMEPSACE=default \
9497
JMP_NAME=test-exporter-legacy \
@@ -98,8 +101,7 @@ EOF
98101
}
99102

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

104106
jmp config client use test-client-oidc
105107

@@ -110,12 +112,7 @@ EOF
110112
}
111113

112114
@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
115+
wait_for_exporter
119116

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

0 commit comments

Comments
 (0)