Skip to content

Commit 5e999a5

Browse files
authored
Merge pull request #78 from jumpstarter-dev/e2e-fix
Fix e2e test
2 parents d7a09cd + a07fb54 commit 5e999a5

File tree

3 files changed

+13
-81
lines changed

3 files changed

+13
-81
lines changed

.github/workflows/e2e.yaml

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: End-to-end tests
22
on:
33
workflow_dispatch:
4-
inputs:
5-
rev:
6-
required: true
7-
default: ""
8-
type: string
94
pull_request:
105
branches:
116
- main
@@ -14,78 +9,7 @@ jobs:
149
e2e-tests:
1510
runs-on: ubuntu-latest
1611
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v4
12+
- uses: jumpstarter-dev/jumpstarter-e2e@main
1913
with:
20-
fetch-depth: 0
21-
22-
- name: Install uv
23-
uses: astral-sh/setup-uv@v2
24-
25-
- name: Install python
26-
run: uv python install 3.12
27-
28-
- name: Install jumpstarter
29-
run: |
30-
if [ -z "${{ inputs.rev }}" ]; then
31-
REV="main"
32-
else
33-
REV="${{ inputs.rev }}"
34-
fi
35-
uv tool install "git+https://github.com/jumpstarter-dev/jumpstarter.git@$REV"
36-
37-
- name: Run make deploy
38-
run: make deploy
39-
40-
- name: Create client
41-
run: |
42-
mkdir -p ~/.config/jumpstarter/clients
43-
go run ./cmd/jmpctl/main.go client create test-client-1 > ~/.config/jumpstarter/clients/test-client-1.yaml
44-
cat <<EOF >> ~/.config/jumpstarter/clients/test-client-1.yaml
45-
drivers:
46-
allow: []
47-
unsafe: True
48-
EOF
49-
50-
- name: Create exporter
51-
run: |
52-
sudo mkdir -p /etc/jumpstarter/exporters
53-
sudo chown $USER /etc/jumpstarter/exporters
54-
55-
go run ./cmd/jmpctl/main.go exporter create test-exporter-1 > /etc/jumpstarter/exporters/test-exporter-1.yaml
56-
cat <<EOF >> /etc/jumpstarter/exporters/test-exporter-1.yaml
57-
export:
58-
power:
59-
type: jumpstarter.drivers.power.driver.MockPower
60-
EOF
61-
kubectl -n default patch exporters.jumpstarter.dev test-exporter-1 \
62-
--type=merge --patch '{"metadata":{"labels":{"example.com/board":"rpi4"}}}'
63-
64-
go run ./cmd/jmpctl/main.go exporter create test-exporter-2 > /etc/jumpstarter/exporters/test-exporter-2.yaml
65-
cat <<EOF >> /etc/jumpstarter/exporters/test-exporter-2.yaml
66-
export:
67-
storage:
68-
type: jumpstarter.drivers.storage.driver.MockStorageMux
69-
EOF
70-
kubectl -n default patch exporters.jumpstarter.dev test-exporter-2 \
71-
--type=merge --patch '{"metadata":{"labels":{"example.com/board":"rpi5"}}}'
72-
73-
- name: Run jumpstarter
74-
run: |
75-
export JUMPSTARTER_GRPC_INSECURE=1
76-
77-
jmp list
78-
jmp-exporter list
79-
80-
jmp-exporter run test-exporter-1 &
81-
jmp-exporter run test-exporter-2 &
82-
83-
sleep 5
84-
85-
jmp shell test-client-1 --label example.com/board rpi4 <<EOF
86-
j power
87-
EOF
88-
89-
jmp shell test-client-1 --label example.com/board rpi5 <<EOF
90-
j storage
91-
EOF
14+
controller-ref: ${{ github.ref }}
15+
jumpstarter-ref: main

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
121121
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
122122

123123
.PHONY: deploy
124-
deploy: ko-build cluster
124+
deploy: ko-build cluster grpcurl
125125
./hack/deploy_with_helm.sh
126126

127127
.PHONY: deploy-exporters
@@ -152,6 +152,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
152152
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
153153
KIND = $(LOCALBIN)/kind-$(KIND_VERSION)
154154
KO = $(LOCALBIN)/ko-$(KO_VERSION)
155+
GRPCURL = $(LOCALBIN)/grpcurl-$(GRPCURL_VERSION)
155156

156157
## Tool Versions
157158
KUSTOMIZE_VERSION ?= v5.4.1
@@ -160,6 +161,7 @@ ENVTEST_VERSION ?= release-0.18
160161
GOLANGCI_LINT_VERSION ?= v1.61.0
161162
KIND_VERSION ?= v0.23.0
162163
KO_VERSION ?= v0.17.0
164+
GRPCURL_VERSION ?= v1.9.2
163165

164166
.PHONY: kustomize
165167
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -186,6 +188,11 @@ ko: $(KO) ## Download ko locally if necessary.
186188
$(KO): $(LOCALBIN)
187189
$(call go-install-tool,$(KO),github.com/google/ko,$(KO_VERSION))
188190

191+
.PHONY: grpcurl
192+
grpcurl: $(GRPCURL) ## Download grpcurl locally if necessary.
193+
$(GRPCURL): $(LOCALBIN)
194+
$(call go-install-tool,$(GRPCURL),github.com/fullstorydev/grpcurl/cmd/grpcurl,$(GRPCURL_VERSION))
195+
189196
.PHONY: helm-lint
190197
helm-lint:
191198
helm lint ./deploy/helm/jumpstarter/

hack/deploy_with_helm.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -eo pipefail
33
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
44

55
KIND=${KIND:-bin/kind-v0.23.0}
6+
GRPCURL=${GRPCURL:-bin/grpcurl-v1.9.2}
67
IMG=${IMG:-quay.io/jumpstarter-dev/jumpstarter-controller:latest}
78
INGRESS_ENABLED=${INGRESS_ENABLED:-false}
89

@@ -108,7 +109,7 @@ echo -e "${GREEN}Waiting for grpc endpoints to be ready:${NC}"
108109
for ep in ${GRPC_ENDPOINT} ${GRPC_ROUTER_ENDPOINT}; do
109110
RETRIES=30
110111
echo -e "${GREEN} * Checking ${ep} ... ${NC}"
111-
while ! podman run docker.io/fullstorydev/grpcurl -insecure ${ep} list; do
112+
while ! ${GRPCURL} -insecure ${ep} list; do
112113
sleep 2
113114
RETRIES=$((RETRIES-1))
114115
if [ ${RETRIES} -eq 0 ]; then

0 commit comments

Comments
 (0)