Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
os:
- ubuntu-24.04
- ubuntu-24.04-arm
- macos-13 # arm-based macOS runners does not support nested virt
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
31 changes: 26 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ runs:
shell: bash
run: |
uv python install 3.12
- name: Install bats
- name: Install bats (Linux)
shell: bash
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y bats bats-support bats-assert
- name: Install bats (macOS)
shell: bash
if: runner.os == 'macOS'
run: |
brew install bats-core bat-extras
- name: Checkout jumpstarter controller
uses: actions/checkout@v4
with:
Expand All @@ -32,6 +38,12 @@ runs:
repository: jumpstarter-dev/jumpstarter
ref: ${{ inputs.jumpstarter-ref }}
path: jumpstarter
- name: Install Docker and Kind (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
brew install colima docker kind go kubectl helm gnu-sed
colima start --network-address --cpu 4 --memory 8 --mount-type virtiofs
- name: Deploy dex
shell: bash
run: |
Expand Down Expand Up @@ -59,12 +71,20 @@ runs:
--group=system:unauthenticated

helm repo add dex https://charts.dexidp.io
helm install --namespace dex --wait -f "$GITHUB_ACTION_PATH"/dex.values.yaml dex dex/dex
helm install --namespace dex --wait --timeout 20m -f "$GITHUB_ACTION_PATH"/dex.values.yaml dex dex/dex

if [[ "$(uname)" == "Darwin" ]]; then
echo "192.168.65.2 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts
gsed -i 's|$("${SCRIPT_DIR}"/get_ext_ip.sh)|192.168.65.2|' ./controller/hack/deploy_with_helm.sh
gsed -i 's|RETRIES=60|RETRIES=600|' ./controller/hack/deploy_with_helm.sh

sudo cp ca.pem /usr/local/share/ca-certificates/dex.crt
sudo update-ca-certificates
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.pem
else
echo "127.0.0.1 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts

echo "127.0.0.1 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts
sudo cp ca.pem /usr/local/share/ca-certificates/dex.crt
sudo update-ca-certificates
fi
- name: Deploy jumpstarter controller
shell: bash
run: |
Expand All @@ -90,6 +110,7 @@ runs:
. .venv/bin/activate

export JUMPSTARTER_GRPC_INSECURE=1
export JUMPSTARTER_FORCE_SYSTEM_CERTS=1

kubectl create -n default sa test-client-sa
kubectl create -n default sa test-exporter-sa
Expand Down
31 changes: 15 additions & 16 deletions tests.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
setup() {
bats_load_library bats-support
bats_load_library bats-assert

bats_require_minimum_version 1.5.0
}

wait_for_exporter() {
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy
}

@test "can create clients with admin cli" {
Expand Down Expand Up @@ -78,17 +89,11 @@ while true; do
done
EOF

kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy
wait_for_exporter
}

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

JMP_NAMEPSACE=default \
JMP_NAME=test-exporter-legacy \
Expand All @@ -98,8 +103,7 @@ EOF
}

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

jmp config client use test-client-oidc

Expand All @@ -110,12 +114,7 @@ EOF
}

@test "can lease and connect to exporters" {
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy
wait_for_exporter

jmp shell --client test-client-oidc --selector example.com/board=oidc j power on
jmp shell --client test-client-sa --selector example.com/board=sa j power on
Expand Down
Loading