-
Notifications
You must be signed in to change notification settings - Fork 64
Add testreporter, _setParams and getTestCaseByVersion #94
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
Conversation
TestLink-API-Python-client v0.4.0-RC1
new TestLink-API-Python-client release candidate v0.4.5-RC1
new TestLink-API-Python-client release
report test case execution + upload test case attachment
Fix getTestCaseCustomFieldValue "version" parameter type
error fix: getTestProjectByName do not return array
TestReporter's subclasses can be used to idempotently generate required components of testlink before sending the report to a specified testcase. TestGenReporter is a default combination of all the TestReporter's subclasses and will try to generate everything it's subclasses is capable of. Added TestLinkHelper._setParams to simplify libraries that need to overwrite how a helper aquires it's parameters Added TestlinkAPIClient.getTestCaseByVersion to expose the common need of gettting the latest testcase by default. It was already used, but not a function in this class and has uses elsewhere. This makes it easier to support different param setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Brian-Williams,
thanks for your TestReporter request. I have some suggestions for improvements.
a) init.py should not import the class TestGenReporter, cause it is an example and uses hard coded url/dev key.
b) separate TestGenReporter and TestReport into two files and move TestGenReporter into the example dir.
Then the functional classes from TestReport can be imported in init.py
c) What about changing the naming of TestReport.AddTestReporter to TestReport.AddTestCaseReporter ?
Using 'Add' as class name prefix is a little bit confusing, cause it mention an action, what normal sounds for a method. But currently I have no better idea.
c) Why does TestGenReporter init TestLinkHelper with a hard coded url and devkey? If this sample should be usable for others, wouldn't it be better to call TestLinkHelper without such hard coded stuff? The other examples like TestLinkExample.py has the preconditions, that the environment variables TESTLINK_API_PYTHON_SERVER_URL and TESTLINK_API_PYTHON_DEVKEY have valid settings.
d) Would it be posssible, that you add a short sample description in doc/usage.rst ?
e) Would it be possible, that you add some tests under tests/utest-offline or tests/utest-online aTestLinkHelper ? If you prefer pytest instead unittest this would be fine also.
f) Why does getTestCaseByVersion raises a RunTimeError and not a TestLinkError or one of its childs?
How do you think about these points?
Regards Luiko
Moved TestGenReporter to it's own file and better documented it's intended use case with warnings.
Hi lczub/Luiko, a) TestGenReporter doesn't have hard coded url or dev key. It's goal is to present the most common use case of always reporting a result if at all possible. In my mind it's value is if other fields are generatable in the future someone's code wouldn't have to be changed in order to get those new benefits. They would simply update this dependency. This model is sometimes used in security repos where there are default objects that will update with the spec. I believe passlib does this. b) I've moved and provided better docs for TestGenReporter. Not importing the functional classes from TestReport is intentional. They started as and are still mostly intended as Mixin classes. I never intended for them to be used in isolation, but after writing them realized some organizations might want only that one functionality. It would be a little silly to force them to create a new mixin instead of importing the functional one. i.e. why force However, I still think that is an edge case. The vast majority of users will be using the classes effectively as mixins which are only adding functionality, which is why the classes have function/method style names. I understand not everyone likes mixin design or naming functions so am open to change, but that was my reasoning. c) That's a better name, done. The naming style is explained above in b. c2) I don't believe it does. Is this talking about the docstring? In my experience most teams using this will have an automation dev key and a single testlink server they are setting it up with. If that's not your experience I would be open to changing the docstring. d+e) I can try to do this when I have more time. f) Changed to TLArgError. I am unexpectedly busy all of the sudden. I will try to get this fit for purpose, but if my responses are slow I apologize in advance. Thanks, |
Hello Brian-Williams, I very much apologize for my missreading of your code. I think with your separation of TestGenReport this pull request is ok and I will pull it into the master and integrate it later on into the tl-future branch. Test and usage.rst will be separate tasks, if we find time for them. Many thanks for your work |
Uh oh!
There was an error while loading. Please reload this page.