Skip to content

Commit 04d205e

Browse files
authored
Merge pull request #48 from numtide/test-all-modules
test all modules
2 parents 2c387c1 + 2b91115 commit 04d205e

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/workflows/build-and-release.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ jobs:
100100
# scan-codeql,
101101
# scan-intermediate-image
102102
]
103+
strategy:
104+
matrix:
105+
module:
106+
- "."
107+
- "./api"
108+
- "./pkg/cluster-handler"
109+
- "./pkg/data-handler"
110+
- "./pkg/resource-handler"
103111
runs-on: ubuntu-latest
104112
steps:
105113
- name: Check out code
@@ -108,19 +116,23 @@ jobs:
108116
- name: Install Go
109117
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
110118
with:
111-
go-version-file: go.mod
119+
go-version-file: ${{ matrix.module }}/go.mod
112120

113121
- name: Run linter
114122
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
123+
with:
124+
working-directory: ${{ matrix.module }}
125+
args: --config=${{ github.workspace }}/.golangci.toml
115126

116127
- name: Run tests
117128
run: |-
129+
cd ${{ matrix.module}}
118130
go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
119131
120132
# - name: Check test coverage
121133
# uses: vladopajic/go-test-coverage@cc5012c2cfa84542e02b079141958a885861d326 # v2.17.0
122134
# with:
123-
# config: ./.testcoverage.yml
135+
# config: ${{ matrix.module }}/.testcoverage.yml
124136

125137
build-scan-push-container:
126138
needs: [ test-go ]

pkg/resource-handler/controller/etcd/etcd_controller_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestHandleDeletion_NoFinalizer(t *testing.T) {
158158
if err != nil {
159159
t.Errorf("handleDeletion() should not error when no finalizer, got: %v", err)
160160
}
161-
if result.Requeue {
161+
if result.RequeueAfter > 0 {
162162
t.Error("handleDeletion() should not requeue when no finalizer")
163163
}
164164
}

pkg/resource-handler/controller/etcd/etcd_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ func TestEtcdReconciler_ReconcileNotFound(t *testing.T) {
732732
if err != nil {
733733
t.Errorf("Reconcile() should not error on NotFound, got: %v", err)
734734
}
735-
if result.Requeue {
735+
if result.RequeueAfter > 0 {
736736
t.Errorf("Reconcile() should not requeue on NotFound")
737737
}
738738
}

0 commit comments

Comments
 (0)