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