generated from replicatedhq/krew-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 5
121 lines (98 loc) · 3.07 KB
/
test.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: test
on:
push:
branches:
- '*'
pull_request:
branches:
- main
# test again
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests with coverage
run: |
go test -v -coverprofile=coverage.out ./...
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
- name: Start minikube
id: minikube
uses: medyagh/[email protected]
with:
cpus: 4
memory: 6000m
- name: Create test PVCs and PODs
run: kubectl apply -f test
- name: Install SSHFS
uses: awalsh128/[email protected]
with:
packages: sshfs openssh-client libfuse3-3
- name: Build pv-mounter
run: make bin
- name: Create mountpoint
run: mkdir foo
- name: Check state of test objects
run: |
kubectl get pod
kubectl get pvc
kubectl get storageclass
- name: Wait for 1st PVC to be ready
run: |
kubectl wait --for=jsonpath='{.status.phase}'=Bound pvc/pvc-1
- name: '[TEST] PVC with RWX access mode'
run: |
./bin/pv-mounter mount default pvc-1 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-1 foo
- name: '[TEST] Unmounted PVC with RWO access mode'
run: |
./bin/pv-mounter mount default pvc-2 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-2 foo
- name: '[TEST] Mounted PVC with RWO access mode'
run: |
./bin/pv-mounter mount --needs-root default pvc-3 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-3 foo
- name: '[TEST] PVC with RWX access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount --needs-root default pvc-4 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-4 foo
- name: '[TEST] Unmounted PVC with RWO access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount default pvc-5 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-5 foo
- name: '[TEST] Mounted PVC with RWO access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount --needs-root default pvc-6 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-6 foo
- name: Delete PODs and PVCs
run: kubectl delete -f test --force --grace-period=0