File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -146,4 +146,21 @@ function setup_envs {
146
146
export TEST_ASSET_KUBECTL=/tmp/kubebuilder/bin/kubectl
147
147
export TEST_ASSET_KUBE_APISERVER=/tmp/kubebuilder/bin/kube-apiserver
148
148
export TEST_ASSET_ETCD=/tmp/kubebuilder/bin/etcd
149
+ export TEST_DEP=/tmp/kubebuilder/init_project
150
+ }
151
+
152
+ function cache_dep {
153
+ header_text " caching inited projects"
154
+ if [ -d " $TEST_DEP " ]; then
155
+ rm -rf " $TEST_DEP "
156
+ fi
157
+ mkdir -p " $TEST_DEP "
158
+ cp -r $PWD /* $TEST_DEP
159
+ }
160
+
161
+ function dump_cache {
162
+ header_text " dump cached project and deps"
163
+ if [ -d " $TEST_DEP " ]; then
164
+ cp -r $TEST_DEP /* .
165
+ fi
149
166
}
Original file line number Diff line number Diff line change @@ -23,8 +23,11 @@ function test_init_project {
23
23
header_text " performing init project"
24
24
kubebuilder init --project-version=v1 --domain example.com <<< " y"
25
25
make
26
+ cache_dep
26
27
}
27
28
29
+
30
+
28
31
function test_init_project_manual_dep_ensure {
29
32
header_text " performing init project w/o dep ensure"
30
33
kubebuilder init --project-version=v1 --domain example.com <<< " n"
@@ -101,27 +104,27 @@ prepare_testdir_under_gopath
101
104
test_init_project_manual_dep_ensure
102
105
103
106
prepare_testdir_under_gopath
104
- test_init_project
107
+ dump_cache
105
108
test_create_api_controller
106
109
107
110
prepare_testdir_under_gopath
108
- test_init_project
111
+ dump_cache
109
112
test_create_namespaced_api_controller
110
113
111
114
prepare_testdir_under_gopath
112
- test_init_project
115
+ dump_cache
113
116
test_create_api_only
114
117
115
118
prepare_testdir_under_gopath
116
- test_init_project
119
+ dump_cache
117
120
test_create_namespaced_api_only
118
121
119
122
prepare_testdir_under_gopath
120
- test_init_project
123
+ dump_cache
121
124
test_create_coretype_controller
122
125
123
126
prepare_testdir_under_gopath
124
- test_init_project
127
+ dump_cache
125
128
test_create_namespaced_coretype_controller
126
129
127
130
exit $rc
You can’t perform that action at this time.
0 commit comments