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 kernel info and timezone info #127

Merged

Conversation

vsibirsk
Copy link

@vsibirsk vsibirsk commented May 4, 2020

Add kernel (release, version, type) and timezone (name, offset) info.

@ILpinto
Copy link

ILpinto commented May 4, 2020

/lgtm

@ILpinto
Copy link

ILpinto commented May 4, 2020

@lukas-bednar please approve

out = self._exec_command(
cmd=cmd, err_msg="Failed to obta kernel info"
)
Kernel = namedtuple('Kernel', values)
Copy link

Choose a reason for hiding this comment

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

kernel, should be all lowercase

Copy link
Author

Choose a reason for hiding this comment

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

made it from capital just to be aligned with already existing code (see Distribution in get_distribution method)

Copy link

Choose a reason for hiding this comment

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

This is wrong, but I guess @lukas-bednar should decide.

Copy link
Member

Choose a reason for hiding this comment

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

I believe this is alright. namedtuple returns a class, and then you create instance of that class. And classes in python should be Uppercased.

out = self._exec_command(
cmd=cmd, err_msg="Failed to obtain timezone info"
)
Timezone = namedtuple('Timezone', values)
Copy link

Choose a reason for hiding this comment

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

ditto

Copy link
Member

@lukas-bednar lukas-bednar left a comment

Choose a reason for hiding this comment

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

In general it looks good to me.

Please add tests which covers new functionality.

@codecov
Copy link

codecov bot commented May 5, 2020

Codecov Report

Merging #127 into master will increase coverage by 0.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   79.54%   79.78%   +0.24%     
==========================================
  Files          19       19              
  Lines        1843     1865      +22     
==========================================
+ Hits         1466     1488      +22     
  Misses        377      377              
Impacted Files Coverage Δ
rrmngmnt/operatingsystem.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2914855...466d073. Read the comment docs.

@vsibirsk vsibirsk requested a review from lukas-bednar May 5, 2020 10:06
Copy link
Member

@lukas-bednar lukas-bednar left a comment

Choose a reason for hiding this comment

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

Looks good, I am just not sure about relevance of negative test-cases.

tests/test_os.py Outdated
@@ -95,6 +110,8 @@ class TestOperatingSystemNegative(object):
),
'python -c "import platform;print(\',\'.join('
'platform.linux_distribution()))"': (1, '', 'SyntaxError'),
'uname -r ; uname -v ; uname -m': (1, '', 'SyntaxError'),
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that uname or date command can raise any SyntaxError , so I believe that these tests are redundant here.
You can either remove them, or think about something more likely happening for these two commands.

Copy link
Member

@lukas-bednar lukas-bednar left a comment

Choose a reason for hiding this comment

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

LGTM

@ILpinto
Copy link

ILpinto commented May 5, 2020

LGTM

@lukas-bednar lukas-bednar added this to the 0.1.23 milestone May 6, 2020
@lukas-bednar lukas-bednar merged commit c43968b into rhevm-qe-automation:master May 6, 2020
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.

4 participants