Skip to content

Commit ed1b804

Browse files
fix test
Signed-off-by: Takeshi Yoshimura <[email protected]>
1 parent a75f112 commit ed1b804

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.github/workflows/build_push_controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and push images
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths:
88
- api/**
99
- cmd/**

.github/workflows/unittest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Archive code coverage results
3434
uses: actions/upload-artifact@v3
3535
with:
36-
name: code-coverage-report
36+
name: operator-code-coverage-report
3737
path: operator-cover.html
3838
device-plugin-test:
3939
runs-on: ubuntu-latest
@@ -52,5 +52,5 @@ jobs:
5252
- name: Archive code coverage results
5353
uses: actions/upload-artifact@v3
5454
with:
55-
name: code-coverage-report
55+
name: device-plugin-code-coverage-report
5656
path: dp-cover.html

controllers/suite_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
logf "sigs.k8s.io/controller-runtime/pkg/log"
2424
"sigs.k8s.io/controller-runtime/pkg/log/zap"
2525

26+
efav1alpha1 "github.com/foundation-model-stack/ocp-efa-operator/api/v1alpha1"
2627
kmmv1beta1 "github.com/kubernetes-sigs/kernel-module-management/api/v1beta1"
2728
securityv1 "github.com/openshift/api/security/v1"
2829
nfdv1alpha1 "github.com/openshift/node-feature-discovery/pkg/apis/nfd/v1alpha1"
29-
efav1alpha1 "github.com/foundation-model-stack/ocp-efa-operator/api/v1alpha1"
3030
corev1 "k8s.io/api/core/v1"
3131
//+kubebuilder:scaffold:imports
3232
)
@@ -43,7 +43,9 @@ const kmmNamespace = "openshift-kmm"
4343
const clusterName = "test"
4444

4545
func TestAPIs(t *testing.T) {
46-
os.Setenv("KUBEBUILDER_ASSETS", "/data/go/src/github.com/foundation-model-stack/ocp-efa-operator/bin/k8s/1.26.0-linux-amd64")
46+
if os.Getenv("KUBEBUILDER_ASSETS") == "" {
47+
os.Setenv("KUBEBUILDER_ASSETS", filepath.Join(build.Default.GOPATH, "src", "github.com", "foundation-model-stack", "ocp-efa-operator", "bin", "k8s", "1.26.0-linux-amd64"))
48+
}
4749
RegisterFailHandler(Fail)
4850

4951
RunSpecs(t, "Controller Suite")

0 commit comments

Comments
 (0)