Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jmnote committed Aug 11, 2024
1 parent babe323 commit 23f7e4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ jobs:
make-test-cover:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v4
- uses: actions/checkout@v3
- run: go mod download
- run: make test
- run: go install github.com/mattn/goveralls@latest
- run: goveralls -coverprofile=cover.out -service=github
Expand Down
10 changes: 8 additions & 2 deletions internal/controller/configmap_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
Expand Down Expand Up @@ -82,15 +83,20 @@ func TestConfigMapReconciler_SetupWithManager(t *testing.T) {
t.Setenv("CONTROLLER_NAMESPACE", tc.namespaceEnv)
t.Log(222)

fakeClient := newFakeClient(tc.objects...)
fakeClientFunc := func(config *rest.Config, options client.Options) (client.Client, error) {
return fakeClient, nil
}
reconciler := &ConfigMapReconciler{
Client: newFakeClient(tc.objects...),
Client: fakeClient,
Scheme: newScheme(),
RulesStore: rulesstore.New(),
}
t.Log(333)

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: newScheme(),
Scheme: newScheme(),
NewClient: fakeClientFunc,
})
t.Log(444)
assert.NoError(t, err)
Expand Down

0 comments on commit 23f7e4b

Please sign in to comment.