Replies: 2 comments
-
Furthermore, I want to ask for one more thing: what is the standard to write tests for functions that involves multiple mixins? For example, if
mcp-atlassian/tests/unit/jira/test_projects.py Lines 428 to 439 in 0f7736e Sorry for much interruption, but I sincerely wish the project better, although I might misunderstand something. I am working at a company using Confluence/Jira, so in a long period I might have utter need for this project. |
Beta Was this translation helpful? Give feedback.
-
@cutekibry, Thanks so much for the great feedback, and huge thanks for jumping in and doing some refactoring today! You're absolutely right about the points you raised (duplication, refactoring needs). I prioritized speed initially, and now structural improvements are definitely needed. Your contributions are incredibly helpful. Thanks again! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Firstly, there is a test called
test_get_project_issues_without_search_mixin
. I do not understand why it exists, since we always use FullJiraClient
and not only ProjectMixins itself.If there is some cases that
search_issues
is unavailable, then it should also be SearchMixins to handle that stuff and returnNone
/ raiseRuntimeError
. Then we testJiraClient.get_project_issues
whensearch_issues
is unavailable.In my opinion, this test is unnecessary, and integration tests needs to blend the necessary mixins together, or just use JiraClient for convenience.
Secondly, there is a duplicate
get_issue
in EpicMixins. It should useget_issue
from IssueMixins. The problem is obvious.For linter errors, we can use Protocols (like Interface in other languages). Example: cutekibry@d627bf3
I understand refactoring is not so important but this problem is relatively easy to fix and if do not fix, it might cause tech debt and many problems.
For example:
IssueMixins.get_issue
might not effect JiraClient since there is a duplicate one in EpicMixins.SearchMixins.get_project_issues
has a jql containsORDER BY created DESC
whileProjectMixins.get_project_issues
does not. They even have different return types.hasattr
in each external function calling to pass the linter tests, even though they are not necessary.If with agreement, I would remove unnecessary tests and duplicate functions in the future when I meet them.
Beta Was this translation helpful? Give feedback.
All reactions