File tree Expand file tree Collapse file tree 4 files changed +78
-3
lines changed Expand file tree Collapse file tree 4 files changed +78
-3
lines changed Original file line number Diff line number Diff line change @@ -270,8 +270,8 @@ catalog-push: ## Push a catalog image.
270
270
$(MAKE ) docker-push IMG=$(CATALOG_IMG )
271
271
272
272
# Test coverage
273
- .PHONY : coverage
274
- coverage : # # Generate test coverage report
273
+ .PHONY : coverage
274
+ coverage : test-env
275
275
go test -v ./... -coverprofile cover.out
276
276
go tool cover -html=cover.out -o cover.html
277
277
@@ -295,4 +295,4 @@ $(BIN_DIR)/setup-envtest-$(SETUP_ENVTEST_VERSION):
295
295
.PHONY : test-env
296
296
test-env :
297
297
make bin/setup-envtest
298
- bin// setup-envtest use $(ENVTEST_K8S_VERSION ) --bin-dir $(BIN_DIR )
298
+ bin/setup-envtest use $(ENVTEST_K8S_VERSION ) --bin-dir $(BIN_DIR )
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 Layer5, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
1
17
package meshsync
2
18
3
19
import (
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 Layer5, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ package meshsync
18
+
19
+ import (
20
+ "testing"
21
+
22
+ mesheryv1alpha1 "github.com/layer5io/meshery-operator/api/v1alpha1"
23
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24
+ )
25
+
26
+ func TestGetObjects (t * testing.T ) {
27
+ m := & mesheryv1alpha1.MeshSync {
28
+ ObjectMeta : metav1.ObjectMeta {
29
+ Name : "test" ,
30
+ Namespace : "test" ,
31
+ },
32
+ Spec : mesheryv1alpha1.MeshSyncSpec {
33
+ Size : 1 ,
34
+ },
35
+ }
36
+ obj := GetObjects (m )
37
+ if obj == nil {
38
+ t .Error ("GetObjects returned nil" )
39
+ }
40
+ if obj [ServerObject ] == nil {
41
+ t .Error ("GetObjects returned nil for server object" )
42
+ }
43
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 Layer5, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
1
17
package meshsync
2
18
3
19
import (
You can’t perform that action at this time.
0 commit comments