-
Notifications
You must be signed in to change notification settings - Fork 181
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
QE: Lazy initialization of Twopence nodes #7334
Conversation
788483a
to
bcef1cd
Compare
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.
lgtm
bcef1cd
to
dc5a85c
Compare
dc5a85c
to
073fc03
Compare
Waiting to pass the full acceptance tests, but looks quite good on my first tests. |
073fc03
to
a900be8
Compare
47ef6bc
to
9bc64a6
Compare
I like the changes ! Just few questions to be sure I understand. |
Having a method run with get_target('server') makes sense but I'm a little bit surprise that we also create a ssh session to get the full_hostname. |
First of all, clarify something, a twopence node instance will not keep a ssh session open, it just keep all the details so it can make ssh calls to a node. And then, we use a global variable to define a hashmap that will contain the twopence node instances, so the nodes once created, will live during all test framework life, they will not be deleted per feature. |
The idea is to have all what we could need from a target contained in the Lavanda Object as attributes. For now, I would not refactor that part, at least not as part of this PR. Because it could bring some unexpected corner cases. |
3ee1c76
to
003a418
Compare
003a418
to
a76f7e2
Compare
What does this PR change?
Related card https://github.com/SUSE/spacewalk/issues/22101
Note: This is a Prove of Concept. Might need a follow up refactor.
Lazy initialization of Twopence nodes:
When we start the test framework, we load the Ruby file twopence_init.rb, this is a plain Ruby file that at the beginning of the file start declaring variables for each fqdn of every systems we handle in the test framework, inside that we call twopence_init() passing by parameter the fqdn, and spend some time establishing a connection with each client.
If a twopence node can't be initialized this cause a failure in the test framework and it stops, which might be good, but the side effect of this is the need to initialize all when we start and that can take a lot of time.
The proposal is to don't initialize any twopence node when the twopence_init.rb file is loaded, but instead we have a getter method to retrieve the specific twopence node we want to use in our step definitions, and the first time we call this getter, we check if the variable is null or has a value, if it has a value, we return the value, if not we call twopence_init() method to initialize that node.
That would decouple responsibilities and outside the test framework, we don't need to care about which clients we will be using in order to initialize them.
GUI diff
No difference.
Documentation
No documentation needed: add explanation. This can't be used if there is a GUI diff
No documentation needed: only internal and user invisible changes
Documentation issue was created: Link for SUSE Manager contributors, Link for community contributors.
API documentation added: please review the Wiki page Writing Documentation for the API if you have any changes to API documentation.
(OPTIONAL) Documentation PR
DONE
Test coverage
Cucumber tests were refactored
DONE
Links
Ports:
Manager-4.3
DONE
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: