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 mockery test case to token reconciler #446

Merged
merged 27 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
15edf23
Optimize logging for repo controller
efiacor Nov 13, 2023
b816d10
Revert removal of finalizer const
efiacor Nov 14, 2023
349f652
Fix formatting
efiacor Nov 14, 2023
9b3a5ae
Add tests using mockery to token reconciler
efiacor Nov 27, 2023
ddd53f4
Merge branch 'nephio-project:main' into token_rec_mockery
efiacor Nov 27, 2023
c1c9fc8
Merge branch 'nephio-project:main' into token_rec_mockery
efiacor Nov 28, 2023
e855c21
Rebase on main
efiacor Nov 28, 2023
ac45014
Merge branch 'main' into token_rec_mockery
liamfallon Dec 4, 2023
ad40b41
Fix go.mod
efiacor Dec 5, 2023
5a4fe15
Merge branch 'main' into token_rec_mockery
efiacor Dec 5, 2023
6b29826
Add testify lib to operators dir mod
efiacor Dec 5, 2023
0748619
Add missing method from interface
efiacor Dec 5, 2023
a6cb358
Merge branch 'nephio-project:main' into token_rec_mockery
efiacor Jan 12, 2024
0181f6f
Optimize logging for repo controller
efiacor Nov 13, 2023
9e9e0c3
Revert removal of finalizer const
efiacor Nov 14, 2023
70dcd07
Add tests using mockery to token reconciler
efiacor Nov 27, 2023
86ea699
Fix go.mod
efiacor Dec 5, 2023
da3c2e0
Fix rebase errors
efiacor Jan 12, 2024
24e8bd8
Update go.mod
efiacor Jan 12, 2024
5e8317d
Revert removal of finalizer const
efiacor Nov 14, 2023
5fcd6f1
Add tests using mockery to token reconciler
efiacor Nov 27, 2023
3593345
Fix go.mod
efiacor Dec 5, 2023
82bb12d
Add missing interface method mock
efiacor Jan 12, 2024
66534d7
Fix mod.go again..
efiacor Jan 12, 2024
ba6cd12
Fix gofmt
efiacor Jan 12, 2024
96a491d
Merge branch 'main' into token_rec_mockery
efiacor Feb 12, 2024
6572b57
Fix rebase conflicts
efiacor Feb 12, 2024
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
6 changes: 6 additions & 0 deletions controllers/pkg/.mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages:
github.com/nephio-project/nephio/controllers/pkg/giteaclient:
interfaces:
GiteaClient:
config:
dir: "{{.InterfaceDir}}"
5 changes: 5 additions & 0 deletions controllers/pkg/giteaclient/giteaclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type GiteaClient interface {
GetRepo(userName string, repoCRName string) (*gitea.Repository, *gitea.Response, error)
CreateRepo(createRepoOption gitea.CreateRepoOption) (*gitea.Repository, *gitea.Response, error)
EditRepo(userName string, repoCRName string, editRepoOption gitea.EditRepoOption) (*gitea.Repository, *gitea.Response, error)
DeleteAccessToken(value interface{}) (*gitea.Response, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious as to why is this an interface{}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

var lock = &sync.Mutex{}
Expand Down Expand Up @@ -161,3 +162,7 @@ func (r *gc) CreateRepo(createRepoOption gitea.CreateRepoOption) (*gitea.Reposit
func (r *gc) EditRepo(userName string, repoCRName string, editRepoOption gitea.EditRepoOption) (*gitea.Repository, *gitea.Response, error) {
return r.giteaClient.EditRepo(userName, repoCRName, editRepoOption)
}

func (r *gc) DeleteAccessToken(value interface{}) (*gitea.Response, error) {
return r.giteaClient.DeleteAccessToken(value)
}
Loading