forked from vanus-labs/vanus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ut): add controller trigger ut (vanus-labs#52)
* test(ut): add controller trigger ut * test: add .codecov.yml Co-authored-by: wenfeng <[email protected]>
- Loading branch information
1 parent
f2604a5
commit 152e8a5
Showing
25 changed files
with
1,247 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70...100" | ||
|
||
parsers: | ||
gcov: | ||
branch_detection: | ||
conditional: yes | ||
loop: yes | ||
method: no | ||
macro: no | ||
|
||
ignore: | ||
- "**/mock*.go" | ||
- "**/fake*.go" | ||
- "**/fake.go" | ||
|
||
comment: | ||
layout: "reach,diff,flags,files,footer" | ||
behavior: default | ||
require_changes: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2022 Linkall Inc. | ||
// | ||
// 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 storage | ||
|
||
import "github.com/golang/mock/gomock" | ||
|
||
type MockStorage struct { | ||
*MockOffsetStorage | ||
*MockSubscriptionStorage | ||
*MockTriggerWorkerStorage | ||
} | ||
|
||
// NewMockStorage creates a new mock instance. | ||
func NewMockStorage(ctrl *gomock.Controller) *MockStorage { | ||
mock := &MockStorage{ | ||
MockOffsetStorage: NewMockOffsetStorage(ctrl), | ||
MockSubscriptionStorage: NewMockSubscriptionStorage(ctrl), | ||
MockTriggerWorkerStorage: NewMockTriggerWorkerStorage(ctrl), | ||
} | ||
return mock | ||
} | ||
|
||
func (m *MockStorage) Close() { | ||
} |
109 changes: 109 additions & 0 deletions
109
internal/controller/trigger/storage/mock_subscription.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
94 changes: 94 additions & 0 deletions
94
internal/controller/trigger/storage/mock_trigger_worker.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.