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

Run yast ui test with ncurse for pvm backend #16035

Merged
merged 1 commit into from Dec 9, 2022
Merged

Conversation

coolgw
Copy link
Contributor

@coolgw coolgw commented Dec 5, 2022

Run yast ui test with ncurse for pvm backend

@coolgw coolgw added the qe-yam label Dec 5, 2022
@github-actions
Copy link

github-actions bot commented Dec 5, 2022

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files

@jknphy
Copy link
Contributor

jknphy commented Dec 6, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

tests/console/yast2_lan.pm Outdated Show resolved Hide resolved
@jknphy
Copy link
Contributor

jknphy commented Dec 8, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

@coolgw could be this code inside the method yast2_console_exec and not all the time outside or is there any troubles with that?
if it simplifies the code we could borrow this: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16020/files#diff-283b909b6e798ec5f92a947c75b4e9ef2cc6805d36e0cdcfadab2b8fbd0a80a0R155

@coolgw
Copy link
Contributor Author

coolgw commented Dec 8, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

@coolgw could be this code inside the method yast2_console_exec and not all the time outside or is there any troubles with that? if it simplifies the code we could borrow this: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16020/files#diff-283b909b6e798ec5f92a947c75b4e9ef2cc6805d36e0cdcfadab2b8fbd0a80a0R155

yast2_console_exec is common function call and it's original design contain a %args can be used for flag ui mode, i do not want yast2_console_exec function contain a hidden hard code logic such as put ncurse mod if is_pvm. I think my implementation has more flexibility and fit original design, the special logic should put on test level not within function level, function level logic should base on parameter.
@ge0r @rakoenig what's your opinion ?

@coolgw coolgw requested review from rakoenig and ge0r December 8, 2022 14:09
@jknphy
Copy link
Contributor

jknphy commented Dec 8, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

@coolgw could be this code inside the method yast2_console_exec and not all the time outside or is there any troubles with that? if it simplifies the code we could borrow this: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16020/files#diff-283b909b6e798ec5f92a947c75b4e9ef2cc6805d36e0cdcfadab2b8fbd0a80a0R155

yast2_console_exec is common function call and it's original design contain a %args can be used for flag ui mode, i do not want yast2_console_exec function contain a hidden hard code logic such as put ncurse mod if is_pvm. I think my implementation has more flexibility and fit original design, the special logic should put on test level not within function level, function level logic should base on parameter. @ge0r @rakoenig what's your opinion ?

it is a hack, because we cannot test PowerVM in a different way, so single point of hack it is better than a hack all over the place, and if someone will face this in the future, needs to put this code again or ask. What I'm not sure if is_pvm would be enough, we need to check if we put inside that is the pvm_hmc one, because for spvm backend it might be possible to run some desktop stuff, I don't know that, we barely use it, only Kernel squad, I didn't see any desktop in the installed system.
Another point is that the fact that the method has some parameters, doesn't mean that you can give a default ones given some special conditions, like it is this case. For the name of the function you always expect ncurses because you are running in the console, but unless you want to do ssh-x in PowerVM you should set a proper default.

@coolgw
Copy link
Contributor Author

coolgw commented Dec 9, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

@coolgw could be this code inside the method yast2_console_exec and not all the time outside or is there any troubles with that? if it simplifies the code we could borrow this: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16020/files#diff-283b909b6e798ec5f92a947c75b4e9ef2cc6805d36e0cdcfadab2b8fbd0a80a0R155

yast2_console_exec is common function call and it's original design contain a %args can be used for flag ui mode, i do not want yast2_console_exec function contain a hidden hard code logic such as put ncurse mod if is_pvm. I think my implementation has more flexibility and fit original design, the special logic should put on test level not within function level, function level logic should base on parameter. @ge0r @rakoenig what's your opinion ?

it is a hack, because we cannot test PowerVM in a different way, so single point of hack it is better than a hack all over the place, and if someone will face this in the future, needs to put this code again or ask. What I'm not sure if is_pvm would be enough, we need to check if we put inside that is the pvm_hmc one, because for spvm backend it might be possible to run some desktop stuff, I don't know that, we barely use it, only Kernel squad, I didn't see any desktop in the installed system. Another point is that the fact that the method has some parameters, doesn't mean that you can give a default ones given some special conditions, like it is this case. For the name of the function you always expect ncurses because you are running in the console, but unless you want to do ssh-x in PowerVM you should set a proper default.

I do not think add extra parameter for yast2_console_exec is a hack, it's normal way to extend function and make it start support more feature, so no hack all over the place, it should give correct parameter for function if needed.
In future if you need add more backend or change backend then you need modify on test module level, not function level, the low api test function level should touch as less as possible. I do not like some hidden logic under the function api, and add condition is_xxx is very popular in os-autoinst-distri-opensuse test module level.
Further more, in function level i do not add any default one or give some special conditions, default logic is as same as before and new logic ONLY happen if you add new parameter, i do not call that special conditions, it's new logic support for new parameter.

@jknphy
Copy link
Contributor

jknphy commented Dec 9, 2022

I think it doesn't make sense to do this hack each time before calling the function, could we consider to do it inside the function?

@coolgw could be this code inside the method yast2_console_exec and not all the time outside or is there any troubles with that? if it simplifies the code we could borrow this: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16020/files#diff-283b909b6e798ec5f92a947c75b4e9ef2cc6805d36e0cdcfadab2b8fbd0a80a0R155

yast2_console_exec is common function call and it's original design contain a %args can be used for flag ui mode, i do not want yast2_console_exec function contain a hidden hard code logic such as put ncurse mod if is_pvm. I think my implementation has more flexibility and fit original design, the special logic should put on test level not within function level, function level logic should base on parameter. @ge0r @rakoenig what's your opinion ?

it is a hack, because we cannot test PowerVM in a different way, so single point of hack it is better than a hack all over the place, and if someone will face this in the future, needs to put this code again or ask. What I'm not sure if is_pvm would be enough, we need to check if we put inside that is the pvm_hmc one, because for spvm backend it might be possible to run some desktop stuff, I don't know that, we barely use it, only Kernel squad, I didn't see any desktop in the installed system. Another point is that the fact that the method has some parameters, doesn't mean that you can give a default ones given some special conditions, like it is this case. For the name of the function you always expect ncurses because you are running in the console, but unless you want to do ssh-x in PowerVM you should set a proper default.

I do not think add extra parameter for yast2_console_exec is a hack, it's normal way to extend function and make it start support more feature, so no hack all over the place, it should give correct parameter for function if needed. In future if you need add more backend or change backend then you need modify on test module level, not function level, the low api test function level should touch as less as possible. I do not like some hidden logic under the function api, and add condition is_xxx is very popular in os-autoinst-distri-opensuse test module level. Further more, in function level i do not add any default one or give some special conditions, default logic is as same as before and new logic ONLY happen if you add new parameter, i do not call that special conditions, it's new logic support for new parameter.

I'm referring that is a hack the fact that we need to adapt the test with that condition, because that env actually has desktop but we don't test it like that, so it is somehow our workaround. I'm fine if you prefer to do it like that, anyway these are legacy methods.

@jknphy jknphy merged commit 9117e3b into os-autoinst:master Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants