Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
fix ci check failures
Browse files Browse the repository at this point in the history
  • Loading branch information
SataQiu committed Oct 21, 2021
1 parent 295cae1 commit 4969d2d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
GO_VERSION: '1.16'
KIND_VERSION: 'v0.10.0'

jobs:
check-license:
Expand Down Expand Up @@ -57,6 +58,16 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Kind Cluster
uses: engineerd/[email protected]
with:
version: ${{ env.KIND_VERSION }}
- name: Install KubeBuilder
uses: RyanSiu1995/[email protected]
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
Expand Down
16 changes: 16 additions & 0 deletions cmd/edgectl/app/util/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2021 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package util

import (
Expand Down
10 changes: 8 additions & 2 deletions pkg/controllers/agent/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ package agent
import (
"path/filepath"
"testing"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
Expand All @@ -50,7 +52,11 @@ func TestAPIs(t *testing.T) {
var _ = BeforeSuite(func(done Done) {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
ControlPlaneStartTimeout: time.Minute,
ControlPlaneStopTimeout: time.Minute,
CRDDirectoryPaths: []string{filepath.Join("../../..", "config", "crd", "bases")},

UseExistingCluster: pointer.BoolPtr(true),
}

var err error
Expand All @@ -68,7 +74,7 @@ var _ = BeforeSuite(func(done Done) {
Expect(k8sClient).ToNot(BeNil())

close(done)
}, 60)
}, 120)

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down
10 changes: 8 additions & 2 deletions pkg/controllers/manager/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ package manager
import (
"path/filepath"
"testing"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
Expand All @@ -50,7 +52,11 @@ func TestAPIs(t *testing.T) {
var _ = BeforeSuite(func(done Done) {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
ControlPlaneStartTimeout: time.Minute,
ControlPlaneStopTimeout: time.Minute,
CRDDirectoryPaths: []string{filepath.Join("../../..", "config", "crd", "bases")},

UseExistingCluster: pointer.BoolPtr(true),
}

var err error
Expand All @@ -68,7 +74,7 @@ var _ = BeforeSuite(func(done Done) {
Expect(k8sClient).ToNot(BeNil())

close(done)
}, 60)
}, 120)

var _ = AfterSuite(func() {
By("tearing down the test environment")
Expand Down

0 comments on commit 4969d2d

Please sign in to comment.