Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console #9632

Merged
merged 6 commits into from
Nov 19, 2019
Merged

[1LP][RFR] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console #9632

merged 6 commits into from
Nov 19, 2019

Conversation

jarovo
Copy link
Contributor

@jarovo jarovo commented Nov 15, 2019

Purpose or Intent

Hopefully an enhancement of how the code is layed out in the repo.

{ py.test: -v cfme/tests/cli/test_appliance_console_db_restore.py }

@jarovo jarovo changed the title [WIPTEST] Extract fixtures cli methods [WIPTEST] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console Nov 15, 2019
import socket
import tempfile
from contextlib import contextmanager
from re import escape as resc
Copy link
Member

Choose a reason for hiding this comment

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

Personally I don't really like renaming this import, thoughts @ManageIQ/qe-committers?

Copy link
Contributor Author

@jarovo jarovo Nov 15, 2019

Choose a reason for hiding this comment

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

I don't like that it seems like some "rescue" would be done. I was not able to find out better name that would still be short for often use. Therefore I suggest using just esc() or just r()?

Hopefully native English speakers will have solution.

Copy link
Contributor Author

@jarovo jarovo Nov 15, 2019

Choose a reason for hiding this comment

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

ree(), e() ?

Copy link
Member

Choose a reason for hiding this comment

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

I would just import re, and call re.escape

@jarovo jarovo changed the title [WIPTEST] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console [RFR] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console Nov 18, 2019
The reconfigure_primary_replication_node is in the appliance_console
attribute of the appliance, not directly in appliance.
@dajoRH
Copy link
Contributor

dajoRH commented Nov 18, 2019

I detected some fixture changes in commit 3adba49

The global fixture ha_appliances_with_providers is used in the following files:

  • cfme/tests/cli/test_appliance_update.py
    • test_update_ha

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@mshriver mshriver self-assigned this Nov 19, 2019
@mshriver mshriver changed the title [RFR] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console [1LP][RFR] Extract ApplianceConsole and fixtures cli methods into cfme.utils.appliance.console Nov 19, 2019
@jawatts jawatts self-assigned this Nov 19, 2019
interaction.send('ap')
interaction.answer('Press any key to continue.', '', timeout=20)
interaction.answer('Choose the advanced setting: ',
'6' if self.appliance.version < '5.10' else '8')
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional since it doesn't change functionality, but we can remove this check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Umn. Quite a good point, but I am also doing upgrade testing and there are some not-automated test doing upgrades on ha setup. There is test_upgrade_multi_ha_inplace which needs to be automated and once I do that, it certainly will use this method and the condition will come handy.

@jawatts
Copy link
Contributor

jawatts commented Nov 19, 2019

Nice work Jaro!!

@jawatts jawatts merged commit 6885ebd into ManageIQ:master Nov 19, 2019
@jarovo
Copy link
Contributor Author

jarovo commented Nov 19, 2019

Nice work Jaro!!

Yeah. Especially when the result is 12 lines shorter than the original.

spusateri pushed a commit to spusateri/integration_tests that referenced this pull request Jan 27, 2020
…e.utils.appliance.console (ManageIQ#9632)

* Extract ApplianceConsole and ApplianceConsoleCli to a plugin.

* Extract non-fixtures from fixtures/cli

* Resolve circular imports

* Fix option configuring the failover monitor.

* Fix Attribute errr: self.appl -> self.appliance

* Fix AttributeError caused by missing appliance_console

The reconfigure_primary_replication_node is in the appliance_console
attribute of the appliance, not directly in appliance.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants