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

env_process: Destroy unrequested VMs via a Setuper #3979

Conversation

bgartzi
Copy link
Contributor

@bgartzi bgartzi commented Aug 27, 2024

Yet another env_process refactoring patch. This time is targeted towards the piece of code destroying those vms that weren't requested by the current test configuration (and still exist in the environment).

ID: 2438

@bgartzi
Copy link
Contributor Author

bgartzi commented Aug 27, 2024

Hi @YongxueHong,

Could you review this too please?

Thanks a lot!

LOG = logging.getLogger(__name__)


class DestroyUnrequestedVMs(Setuper):
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @bgartzi
I see your point. The name DestroyUnrequestedVMs does sound quite specific and focuses only on the destruction aspect, while the actual functionality seems to handle both destroying and keeping the VMs, depending on the situation.
So I think we may choose a suitable name for both aspects, such as UnrequestedVMsHandler, UnrequestedVMsManager, and so on.
Anyway, the naming depends on how you view the class's role. I'd like to hear your thoughts.
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @YongxueHong,

Thanks for sharing. Now that you mention it, I agree with you.

Let me update it really quick.

Refactor the piece of code that destroyed the unrequested VMs (if asked
so) into a setuper. Import that class into env_process and register it
into the setup_manager.

Signed-off-by: Beñat Gartzia Arruabarrena <[email protected]>
@bgartzi bgartzi force-pushed the env_process_refactoring-kill_unrequested_vms branch from 6dc943d to 0514790 Compare September 3, 2024 05:18
Copy link
Contributor

@YongxueHong YongxueHong left a comment

Choose a reason for hiding this comment

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

LGTM.

@YongxueHong YongxueHong merged commit 37e94de into avocado-framework:master Sep 3, 2024
50 checks passed
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.

2 participants