diff --git a/.tekton/doc.yaml b/.tekton/doc.yaml index 36e4d5b2a..8ff738c11 100644 --- a/.tekton/doc.yaml +++ b/.tekton/doc.yaml @@ -40,7 +40,7 @@ spec: - name: source steps: - name: hugo-gen - image: registry.access.redhat.com/ubi9/python-311 # using this image since it has git and curl and python + image: registry.access.redhat.com/ubi9/python-311 # using this image since it has git and curl and python workingDir: $(workspaces.source.path) env: - name: UPLOADER_PUBLIC_URL diff --git a/.tekton/go.yaml b/.tekton/go.yaml index 96ed07f6d..0b3bf9d55 100644 --- a/.tekton/go.yaml +++ b/.tekton/go.yaml @@ -56,6 +56,7 @@ spec: script: | #!/usr/bin/env bash set -eux + git config --global --add safe.directory $(workspaces.source.path) mkdir -p ${GOCACHE} ${GOMODCACHE} ${GOLANGCILINT_CACHE} cd $(dirname ${GOCACHE}) @@ -81,6 +82,7 @@ spec: script: | #!/usr/bin/env bash set -eux + git config --global --add safe.directory $(workspaces.source.path) export GO_TEST_FLAGS="-v -race -coverprofile=coverage.txt -covermode=atomic" make test @@ -105,6 +107,8 @@ spec: workingDir: $(workspaces.source.path) script: | #!/usr/bin/env bash + set -eux + git config --global --add safe.directory $(workspaces.source.path) currentsha=$(git rev-parse HEAD) git fetch --tag -v git checkout main diff --git a/pkg/webhook/reconciler_test.go b/pkg/webhook/reconciler_test.go new file mode 100644 index 000000000..d28f561ef --- /dev/null +++ b/pkg/webhook/reconciler_test.go @@ -0,0 +1,27 @@ +package webhook + +import ( + "context" + "testing" +) + +func Test_reconciler_Reconcile(t *testing.T) { + tests := []struct { + name string + wantErr bool + }{ + { + // TODO: make it a more complete test + name: "run reconcile", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ac := &reconciler{} + if err := ac.Reconcile(context.Background(), ""); (err != nil) != tt.wantErr { + t.Errorf("reconciler.Reconcile() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +}