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

Open
wants to merge 11 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@kvprasoon
Copy link
Contributor

commented Jul 6, 2019

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

This comment has been minimized.

@ansibot ansibot added needs_revision and removed core_review labels Jul 6, 2019

@kvprasoon

This comment has been minimized.

Copy link
Contributor Author

commented Jul 6, 2019

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

@ShachafGoldstein

This comment has been minimized.

Copy link
Contributor

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 label Jul 6, 2019

@ShachafGoldstein

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2019

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 added some commits Jul 7, 2019

@kvprasoon

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2019

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

@ansibot ansibot added core_review and removed needs_revision labels Jul 7, 2019

@kvprasoon

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

@ShachafGoldstein @jborean93 Are we good here ?

@ShachafGoldstein

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

Nothing more from me

@nitzmahone
Copy link
Member

left a comment

couple little things

Show resolved Hide resolved 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

@ansibot ansibot removed the stale_ci label Jul 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.