----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/ -----------------------------------------------------------
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description -------
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to * repair all broken tests * add all tests mentioned * bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs -----
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing -------
Thanks,
Jan Grec
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment959
Use 'cls' instead of 'self' in classmethods. See pep8: http://www.python.org/dev/peps/pep-0008/#function-and-method-arguments
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment960
What is the purpose of this function? Remove epoch from NVR? If so then note that epoch could be arbitrary number, this works only for epoch <0..9>.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment961
I would rather use endswith:
for arch in ("x86_64", "noarch", "amd64", "i686", "i386"): if word.endswith(arch): ...
But that's not really an issue.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment962
use "assertListEqual", it produces better output when the test fails
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment963
The matching against 'yum list available' is missing. If it is on purpose, add at least a TODO comment.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment964
assertEqual -> assertListEqual
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment965
You can use
.InstalledSoftware.InstanceID
instead of
.path["InstalledSoftware"]["InstanceID"]
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment966
typo: rise -> raise (occurs multiple times)
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment967
Don't use PG_ComputerSystem directly, there should be LMI_CS_CLASSNAME env var, see https://fedorahosted.org/openlmi/ticket/161
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment968
self.assertIsNone()
The test suite looks good to me in general. I don't have any objections against merging it into upstream repo, but I would like to let Michal decide if he is satisfied with the test suite this way.
- Radek Novacek
On Oct. 30, 2013, 3:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 3:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 98 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line98
What is the purpose of this function? Remove epoch from NVR? If so then note that epoch could be arbitrary number, this works only for epoch <0..9>.
Yeah, some kind of description "why?" would be helpful. I would use regular expression: string = re.sub(r'-\d+:', '-', string)
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 255 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line255
use "assertListEqual", it produces better output when the test fails
Unfortunately this is available since python 2.7.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 592 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line592
self.assertIsNone()
Again, since python 2.7.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 312 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line312
You can use .InstalledSoftware.InstanceID instead of .path["InstalledSoftware"]["InstanceID"]
From what I know:
.InstalledSoftware["InstanceID"] Because InstalledSoftware is an instance of pywbem.CIMInstanceName, which doesn't allow for smart attribute access.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 300 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line300
assertEqual -> assertListEqual
Since python 2.7.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 284 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line284
The matching against 'yum list available' is missing. If it is on purpose, add at least a TODO comment.
This should be achievable. Try to remove installed packages and duplicities from lmi list and compare them. (I haven't tried).
- Michal
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
On Oct. 30, 2013, 2:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 2:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
On Oct. 30, 2013, 3:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 98 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line98
What is the purpose of this function? Remove epoch from NVR? If so then note that epoch could be arbitrary number, this works only for epoch <0..9>.
Michal Minar wrote: Yeah, some kind of description "why?" would be helpful. I would use regular expression: string = re.sub(r'-\d+:', '-', string)
Actually not used anywhere in the code, so I'm removing it completely.
On Oct. 30, 2013, 3:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 255 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line255
use "assertListEqual", it produces better output when the test fails
Michal Minar wrote: Unfortunately this is available since python 2.7.
I'm afraid there are more pieces of tests code that won't work on 2.6
Shall we strictly support python 2.6 and more, or is it ok to run with 2.7 and eventually rewrite tests for older python versions when it's needed?
On Oct. 30, 2013, 3:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 312 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line312
You can use .InstalledSoftware.InstanceID instead of .path["InstalledSoftware"]["InstanceID"]
Michal Minar wrote: From what I know: .InstalledSoftware["InstanceID"] Because InstalledSoftware is an instance of pywbem.CIMInstanceName, which doesn't allow for smart attribute access.
This shortcut somewhere works for me, but in this specific place is doesn't.
TypeError: 'LMIInstanceName' object has no attribute '__getitem__'
- Jan
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
On Oct. 30, 2013, 3:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 3:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
On Oct. 30, 2013, 3:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 284 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line284
The matching against 'yum list available' is missing. If it is on purpose, add at least a TODO comment.
Michal Minar wrote: This should be achievable. Try to remove installed packages and duplicities from lmi list and compare them. (I haven't tried).
Skipping this one for now.
Although it'd be great to know exactly whether listing available packages returns correct available packages, there's no exact process to get them in lmi itself.
From packages returned, we'd have to remove all packages with package names that are already installed and their epoch or version is lesser omitting updates which requires package name parsing etc. etc.
I suppose this is going to be an openlmi-scripts functionality and therefore should be tested there, not in lmi itself.
- Jan
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
On Oct. 30, 2013, 3:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 3:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 255 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line255
use "assertListEqual", it produces better output when the test fails
Michal Minar wrote: Unfortunately this is available since python 2.7.
Jan Grec wrote: I'm afraid there are more pieces of tests code that won't work on 2.6
Shall we strictly support python 2.6 and more, or is it ok to run with 2.7 and eventually rewrite tests for older python versions when it's needed?
I'd rather stick with code compatible with 2.6. True, not all of the current code works with 2.6 but this is not the reason to use new features from 2.7 since we know these tests need to pass on 2.6 sooner or later.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 284 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line284
The matching against 'yum list available' is missing. If it is on purpose, add at least a TODO comment.
Michal Minar wrote: This should be achievable. Try to remove installed packages and duplicities from lmi list and compare them. (I haven't tried).
Jan Grec wrote: Skipping this one for now.
Although it'd be great to know exactly whether listing available packages returns correct available packages, there's no exact process to get them in lmi itself. From packages returned, we'd have to remove all packages with package names that are already installed and their epoch or version is lesser omitting updates which requires package name parsing etc. etc. I suppose this is going to be an openlmi-scripts functionality and therefore should be tested there, not in lmi itself.
Fair enough.
On Oct. 30, 2013, 2:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 312 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line312
You can use .InstalledSoftware.InstanceID instead of .path["InstalledSoftware"]["InstanceID"]
Michal Minar wrote: From what I know: .InstalledSoftware["InstanceID"] Because InstalledSoftware is an instance of pywbem.CIMInstanceName, which doesn't allow for smart attribute access.
Jan Grec wrote: This shortcut somewhere works for me, but in this specific place is doesn't.
TypeError: 'LMIInstanceName' object has no attribute '__getitem__'
Please update your openlmi-tools (to version 0.9). Actually now it's not "You can use", but "You must use".
- Michal
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
On Oct. 30, 2013, 2:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 2:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
On Oct. 30, 2013, 3:44 p.m., Radek Novacek wrote:
src/software/test/testSoftware.py, line 255 http://reviewboard-openlmi.rhcloud.com/r/1147/diff/1/?file=6187#file6187line255
use "assertListEqual", it produces better output when the test fails
Michal Minar wrote: Unfortunately this is available since python 2.7.
Jan Grec wrote: I'm afraid there are more pieces of tests code that won't work on 2.6
Shall we strictly support python 2.6 and more, or is it ok to run with 2.7 and eventually rewrite tests for older python versions when it's needed?
Michal Minar wrote: I'd rather stick with code compatible with 2.6. True, not all of the current code works with 2.6 but this is not the reason to use new features from 2.7 since we know these tests need to pass on 2.6 sooner or later.
Okay, I'll change it back to assertEqual.
Also docs for assertEqual says: "In addition, if first and second are the exact same type and one of list, tuple, dict, set, frozenset or unicode or any type that a subclass registers with addTypeEqualityFunc() the type-specific equality function will be called in order to generate a more useful default error message (see also the list of type-specific methods)." so I guess assertEqual doesn't matter.
- Jan
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1566 -----------------------------------------------------------
On Oct. 30, 2013, 3:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 3:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1567 -----------------------------------------------------------
Besides the issues found by Radek and smaller typos, I like it.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment969
mask -> mark
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment970
missing closing '}'
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment971
I like this. Nice and simple.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment973
packags -> packages
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment978
*inst* is a little bit misleading. I would add an 's' to it: insts = ...
- Michal Minar
On Oct. 30, 2013, 2:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 2:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/#review1652 -----------------------------------------------------------
Due to changes in lmishell (v0.8 -> v0.9) some usage patterns won't work. I've picked few of them and opened an issue. Please try the test against the software provider with update openlmi-tools to ensure validity of this code.
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment1002
This won't work, use: iname.InstalledSoftware.InstanceID
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment1003
Please use: it.InstanceID
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment1004
nevra = iname.InstalledSoftware.InstanceID[len("LMI:LMI_SoftwareIdentity:"):] package_list.append(nevra)
src/software/test/testSoftware.py http://reviewboard-openlmi.rhcloud.com/r/1147/#comment1005
name = it.InstanceID[len("LMI:LMI_SoftwareIdentity:"):]
- Michal Minar
On Oct. 30, 2013, 2:03 p.m., Jan Grec wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/
(Updated Oct. 30, 2013, 2:03 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to
- repair all broken tests
- add all tests mentioned
- bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing
Thanks,
Jan Grec
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1147/ -----------------------------------------------------------
(Updated Lis. 13, 2014, 11:52 dop.)
Status ------
This change has been discarded.
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description -------
software - tests: software test suite with basic tests
This is only a "current-status" review. I'll be very thankful for any comments on what's wrong, how the structure should look like, etc.
My TODO is to * repair all broken tests * add all tests mentioned * bind test suite with new LmiTestCase class
I apologize for inconvenience, but I wasn't able to save previous review notes.
Diffs -----
src/software/test/lmi-test.repo PRE-CREATION src/software/test/testSoftware.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/1147/diff/
Testing -------
Thanks,
Jan Grec
openlmi-reviews@lists.fedorahosted.org