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

Added basic set of unit tests for gitea/client.go #10

Merged
merged 3 commits into from
Apr 20, 2021
Merged

Added basic set of unit tests for gitea/client.go #10

merged 3 commits into from
Apr 20, 2021

Conversation

jsuchome
Copy link
Member

@jsuchome jsuchome commented Apr 16, 2021

#10

@jsuchome jsuchome marked this pull request as ready for review April 20, 2021 08:22
Copy link
Member

@stefannica stefannica left a comment

Choose a reason for hiding this comment

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

Looks great, thank you.

Based on this first occurrence, I'm slightly concerned that we'll need a lot of code in order to mock the behavior of external services like the gitea server here. For example, I assume we'll need to do the same for the tekton client, and expand this fake gitea server to cover API calls related to git repository contents: tags, commits, branches etc.

On the other hand, I agree with this approach, even more so since I can't think of a better solution.

pkg/core/gitea/client_test.go Outdated Show resolved Hide resolved
Also add logger option to giteaAdminClient struct to make it possible
to change the logger or suppress it complete e.g. during test run.

Also rename methods in our API so they do not have the same
name as Gitea API to reduce possible confusion
@jsuchome jsuchome merged commit 68a6fe4 into fuseml:main Apr 20, 2021
@jsuchome jsuchome deleted the giteaclient-tests branch April 20, 2021 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants