Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add placeholder reconcile test #1345

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tekton/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .tekton/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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

Expand All @@ -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
Expand Down
27 changes: 27 additions & 0 deletions pkg/webhook/reconciler_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
})
}
}
Loading