Skip to content

Allow multiple hostnames in a single call#424

Merged
jose-caballero merged 1 commit intomainfrom
allow_list_hypervisors_in_create_server_action
Jan 13, 2026
Merged

Allow multiple hostnames in a single call#424
jose-caballero merged 1 commit intomainfrom
allow_list_hypervisors_in_create_server_action

Conversation

@jose-caballero
Copy link
Copy Markdown
Contributor

@jose-caballero jose-caballero commented Jan 5, 2026

Description:

Allow multiple hypervisor hostnames in a single call to action hv.create.test.server

Submitter:

Have you (where applicable):

  • [ X ] Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • [ X ] Place non-StackStorm code into the lib directory?
  • [ X ] Have unit tests for the action/sensor and lib layers?
  • [ X ] Have clear and obvious action parameter names and descriptions?

@jose-caballero jose-caballero marked this pull request as draft January 5, 2026 14:23
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.88%. Comparing base (05a3b00) to head (e4d97e6).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lib/workflows/hv_create_test_server.py 85.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #424      +/-   ##
===========================================
- Coverage   100.00%   99.88%   -0.12%     
===========================================
  Files          109      109              
  Lines         2579     2598      +19     
  Branches       316      320       +4     
===========================================
+ Hits          2579     2595      +16     
- Misses           0        3       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jose-caballero jose-caballero marked this pull request as ready for review January 5, 2026 14:30
@jose-caballero jose-caballero marked this pull request as draft January 6, 2026 08:15
@jose-caballero jose-caballero force-pushed the allow_list_hypervisors_in_create_server_action branch 3 times, most recently from db2ee12 to f9f0192 Compare January 6, 2026 09:47
@jose-caballero jose-caballero marked this pull request as ready for review January 6, 2026 09:50
Comment thread lib/workflows/hv_create_test_server.py Outdated
@jose-caballero jose-caballero force-pushed the allow_list_hypervisors_in_create_server_action branch from f9f0192 to a44a557 Compare January 6, 2026 10:46
Comment thread tests/lib/workflows/test_hv_create_test_server.py
Comment thread tests/lib/workflows/test_hv_create_test_server.py Outdated
@jose-caballero jose-caballero force-pushed the allow_list_hypervisors_in_create_server_action branch from a44a557 to 16b1ac9 Compare January 6, 2026 13:07
Comment thread lib/workflows/hv_create_test_server.py Outdated
Comment thread lib/workflows/hv_create_test_server.py Outdated
@jose-caballero jose-caballero force-pushed the allow_list_hypervisors_in_create_server_action branch 3 times, most recently from b2dbc6c to 948cee9 Compare January 7, 2026 13:37
Comment thread lib/workflows/hv_create_test_server.py
Comment thread tests/lib/workflows/test_hv_create_test_server.py
Copy link
Copy Markdown
Contributor

@Dmitry-Popovichev Dmitry-Popovichev left a comment

Choose a reason for hiding this comment

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

lgtm

@khalford
Copy link
Copy Markdown
Member

khalford commented Jan 9, 2026

There have been lots of changes since this was opened. Has it been tested in dev?

@jose-caballero
Copy link
Copy Markdown
Contributor Author

@khalford where is the documentation for that?

@khalford
Copy link
Copy Markdown
Member

@khalford where is the documentation for that?

@jose-caballero https://stfc.atlassian.net/wiki/spaces/SC/pages/569507848/Installation+and+Configuration+StackStorm

We don't have documentation on testing code in dev. What you do is set up a dev StackStorm instance and run the action there. If it works, great.

We want to be able to run the action "hv.create.test.server"
on more than one hypervisor at a time.

With this change, we allow passing more than one hostname as input option,
split by either comma or colon signs.

The execution for each individual hypervisor remains the same.

The form has also been updated to reflect the change:
* The parameter is now called "hypervisor_names", plural.
* The parameter description explains the options.

In order to facilitate this new functionality, the source code has been
refactored as follows:

* The original function "create_test_server()" has been renamed,
  and a new one was added with the same name
  As the original function "create_test_server()" was renamed,
  the original unittest code needs to be updated to point to the new one.
  The function raises an Exception when the hypervisor name is not
  proper.

* A new implementation for "create_test_server()" has been created.

* An ancillary function to convert the single string with the list of
  hypervisor names into a python list has been added: _str_to_list().
  This ancillary function raises an Exception when both commas and
  colons are used at the same time as delimiters.

* New unit tests have been added to check the new functionalities:
  * verify that create_test_server() raises an Exception when the
    hypervisor name is not correct:
      * it is empty
      * it includes a comma (,)
      * it includes a colon (:)
  * verity that _str_to_list() raises an Exception when commas and
    colons as used at the same time.
  * verify that _str_to_list() always return the expected output
@jose-caballero jose-caballero force-pushed the allow_list_hypervisors_in_create_server_action branch from 948cee9 to e4d97e6 Compare January 12, 2026 08:41
@khalford khalford dismissed their stale review January 12, 2026 13:49

Dismissing my own review

@jose-caballero jose-caballero dismissed meoflynn’s stale review January 13, 2026 07:35

already 2 approved

@jose-caballero jose-caballero merged commit 846c390 into main Jan 13, 2026
12 of 14 checks passed
@jose-caballero jose-caballero deleted the allow_list_hypervisors_in_create_server_action branch January 13, 2026 07:35
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.

5 participants