Skip to content

Commit 2daf17b

Browse files
committed
unit tests
1 parent dd40af6 commit 2daf17b

File tree

1 file changed

+125
-0
lines changed

1 file changed

+125
-0
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
suite: priorityClass
2+
release:
3+
name: sourcegraph
4+
namespace: sourcegraph
5+
tests:
6+
- it: should render single priority class
7+
template: priorityClass.yaml
8+
set:
9+
priorityClasses:
10+
- name: gitserver-class
11+
value: 100
12+
preemptionPolicy: Never
13+
description: "gitserver priority class"
14+
asserts:
15+
- equal:
16+
path: metadata.name
17+
value: gitserver-class
18+
- equal:
19+
path: value
20+
value: 100
21+
- equal:
22+
path: preemptionPolicy
23+
value: Never
24+
- equal:
25+
path: description
26+
value: "gitserver priority class"
27+
- it: should render two priority classes
28+
template: priorityClass.yaml
29+
set:
30+
priorityClasses:
31+
- name: gitserver-class
32+
value: 100
33+
preemptionPolicy: Never
34+
description: "gitserver priority class"
35+
- name: indexed-search-class
36+
value: 101
37+
preemptionPolicy: PreemptLowerPriority
38+
description: "indexed-search priority class"
39+
asserts:
40+
- equal:
41+
path: metadata.name
42+
value: gitserver-class
43+
documentIndex: 0
44+
- equal:
45+
path: value
46+
value: 100
47+
documentIndex: 0
48+
- equal:
49+
path: preemptionPolicy
50+
value: Never
51+
documentIndex: 0
52+
- equal:
53+
path: description
54+
value: "gitserver priority class"
55+
documentIndex: 0
56+
- equal:
57+
path: metadata.name
58+
value: indexed-search-class
59+
documentIndex: 1
60+
- equal:
61+
path: value
62+
value: 101
63+
documentIndex: 1
64+
- equal:
65+
path: preemptionPolicy
66+
value: PreemptLowerPriority
67+
documentIndex: 1
68+
- equal:
69+
path: description
70+
value: "indexed-search priority class"
71+
documentIndex: 1
72+
- it: set priority class on gitserver
73+
template: gitserver/gitserver.StatefulSet.yaml
74+
set:
75+
gitserver:
76+
priorityClassName: gitserver-class
77+
asserts:
78+
- equal:
79+
path: spec.template.spec.priorityClassName
80+
value: gitserver-class
81+
- it: set priority class on indexed-search
82+
template: indexed-search/indexed-search.StatefulSet.yaml
83+
set:
84+
indexedSearch:
85+
priorityClassName: indexed-search-class
86+
asserts:
87+
- equal:
88+
path: spec.template.spec.priorityClassName
89+
value: indexed-search-class
90+
- it: set priority class on searcher
91+
template: searcher/searcher.StatefulSet.yaml
92+
set:
93+
searcher:
94+
priorityClassName: searcher-class
95+
asserts:
96+
- equal:
97+
path: spec.template.spec.priorityClassName
98+
value: searcher-class
99+
- it: set priority class on symbols
100+
template: symbols/symbols.StatefulSet.yaml
101+
set:
102+
symbols:
103+
priorityClassName: symbols-class
104+
asserts:
105+
- equal:
106+
path: spec.template.spec.priorityClassName
107+
value: symbols-class
108+
- it: set priority class on redisCache
109+
template: redis/redis-cache.Deployment.yaml
110+
set:
111+
redisCache:
112+
priorityClassName: redis-cache-class
113+
asserts:
114+
- equal:
115+
path: spec.template.spec.priorityClassName
116+
value: redis-cache-class
117+
- it: set priority class on redisStore
118+
template: redis/redis-store.Deployment.yaml
119+
set:
120+
redisStore:
121+
priorityClassName: redis-store-class
122+
asserts:
123+
- equal:
124+
path: spec.template.spec.priorityClassName
125+
value: redis-store-class

0 commit comments

Comments
 (0)