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

Add support for test script parameters in win_pester #58790

Merged
merged 13 commits into from
Jul 22, 2019

Conversation

kvprasoon
Copy link
Contributor

SUMMARY

This PR is to add support for using parameters in test script.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_pester

ADDITIONAL INFORMATION

This allows user to pass parameters like below

  - name: Execute tests with parameter
    win_pester:
      path: c:\temp\testscript.tests.ps1
      parameterlist:
        param1: value1
        param2: value2

@ansibot
Copy link
Contributor

ansibot commented Jul 6, 2019

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community labels Jul 6, 2019
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jul 6, 2019
@kvprasoon
Copy link
Contributor Author

@jborean93 Can you check the test failure once, I think it's not related to the change

@ShachafGoldstein
Copy link
Contributor

ShachafGoldstein commented Jul 6, 2019

Seems the changes caused a stack overflow with a recursion in the return object

I'm not sure what but the changes you added seem to return an object that the serialization of which are recursive or that calls to itself

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jul 6, 2019
@ShachafGoldstein
Copy link
Contributor

Just a thought, I can't test it right now but maybe your if is always true since the test that fails only has the path parameter

@ShachafGoldstein
Copy link
Contributor

I stand corrected, Path is an alias to script, and it seems the issue comes from the test script you added.
it is copied to the host then run as part of all the scripts in the folder and maybe that is what causes the overflow

@kvprasoon
Copy link
Contributor Author

Fixed the overflow issue and the test file name was wrong, fixed that as well, CI should pass now.

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jul 7, 2019
@kvprasoon
Copy link
Contributor Author

@ShachafGoldstein @jborean93 Are we good here ?

@ShachafGoldstein
Copy link
Contributor

Nothing more from me

Copy link
Member

@nitzmahone nitzmahone left a comment

Choose a reason for hiding this comment

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

couple little things

test/integration/targets/win_pester/defaults/main.yml Outdated Show resolved Hide resolved
test/integration/targets/win_pester/tasks/test.yml Outdated Show resolved Hide resolved
lib/ansible/modules/windows/win_pester.ps1 Outdated Show resolved Hide resolved
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jul 16, 2019
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 16, 2019
@kvprasoon
Copy link
Contributor Author

@nitzmahone changes made as per comments.

Copy link
Contributor

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Few minor nits in the code and some doc updates needed but looks great.

lib/ansible/modules/windows/win_pester.ps1 Outdated Show resolved Hide resolved
lib/ansible/modules/windows/win_pester.ps1 Outdated Show resolved Hide resolved
lib/ansible/modules/windows/win_pester.ps1 Outdated Show resolved Hide resolved
lib/ansible/modules/windows/win_pester.py Outdated Show resolved Hide resolved
lib/ansible/modules/windows/win_pester.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Looks great.

@jborean93 jborean93 merged commit a20afb5 into ansible:devel Jul 22, 2019
@kvprasoon kvprasoon deleted the pester-args branch July 23, 2019 03:09
@ansible ansible locked and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants