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

win_scheduled_tasks: Improve example test framework #22833

Merged
merged 1 commit into from
Mar 24, 2017

Conversation

dagwieers
Copy link
Contributor

SUMMARY

Updated as discussed in previous Test Working Group.

Changes include:

  • Moving the tests directly with the task
  • Make the asserts depending on ansible_check_mode
  • Add more tests for enabling/disabling scheduled tasks
ISSUE TYPE
  • Integration Test Pull Request
COMPONENT NAME

win_scheduled_task

ANSIBLE VERSION

v2.3

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. test_pull_requests labels Mar 21, 2017
@dagwieers
Copy link
Contributor Author

dagwieers commented Mar 21, 2017

@mattclay @bcoca @gundalow @nitzmahone @jborean93 The new and improved version is here.

It isn't as concise as before (the asserts are now scattered all over), but the relation between task and error is now clearer. I like the original implementation more, but it requires proper variable names when registering to make any sense from it.

Also I wonder whether the playbook itself should be running the tests in check-mode, or whether we want this to be done from outside of the playbook. (But in that case all tests need to adhere to this scheme, and that's going to be near to impossible...)

@dagwieers
Copy link
Contributor Author

dagwieers commented Mar 21, 2017

Shippable error unrelated to this change:

2017-03-21 14:11:05 Run command: ansible -m win_ping -i windows_2012-R2_RTM, windows_2012-R2_RTM -e 'ansible_connection=winrm ansible_host=ec2-52-14-214-122.us-east-2.compute.amazonaws.com ansible_user=administrator ansible_password=o4*c4#h8%A0^b3&y7#U5^ ansible_port=5986 ansible_winrm_server_cert_validation=ignore'
2017-03-21 14:12:22 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ReadTimeout: HTTPSConnectionPool(host='ec2-52-14-214-122.us-east-2.compute.amazonaws.com', port=5986): Read timed out. (read timeout=30)
2017-03-21 14:12:22 windows_2012-R2_RTM | FAILED! => {
2017-03-21 14:12:22     "failed": true, 
2017-03-21 14:12:22     "msg": "Unexpected failure during module execution.", 
2017-03-21 14:12:22     "stdout": ""
2017-03-21 14:12:22 }
2017-03-21 14:12:32 Run command: ansible -m win_ping -i windows_2012-R2_RTM, windows_2012-R2_RTM -e 'ansible_connection=winrm ansible_host=ec2-52-14-214-122.us-east-2.compute.amazonaws.com ansible_user=administrator ansible_password=o4*c4#h8%A0^b3&y7#U5^ ansible_port=5986 ansible_winrm_server_cert_validation=ignore'
2017-03-21 14:12:36 windows_2012-R2_RTM | SUCCESS => {
2017-03-21 14:12:36     "changed": false, 
2017-03-21 14:12:36     "ping": "pong"
2017-03-21 14:12:36 }
2017-03-21 14:12:36 ERROR: 504: Cannot parse response as JSON:
2017-03-21 14:12:36 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2017-03-21 14:12:36 <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
2017-03-21 14:12:36 <TITLE>ERROR: The request could not be satisfied</TITLE>
2017-03-21 14:12:36 </HEAD><BODY>
2017-03-21 14:12:36 <H1>ERROR</H1>
2017-03-21 14:12:36 <H2>The request could not be satisfied.</H2>
2017-03-21 14:12:36 <HR noshade size="1px">
2017-03-21 14:12:36 CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
2017-03-21 14:12:36 <BR clear="all">
2017-03-21 14:12:36 <HR noshade size="1px">
2017-03-21 14:12:36 <PRE>
2017-03-21 14:12:36 Generated by cloudfront (CloudFront)
2017-03-21 14:12:36 Request ID: -k4OQ9v1GASq0jsESySek9JGZhmwZgzLjUpyYXzSnweKla1XVMTQPw==
2017-03-21 14:12:36 </PRE>
2017-03-21 14:12:36 <ADDRESS>
2017-03-21 14:12:36 </ADDRESS>
2017-03-21 14:12:36 </BODY></HTML>

These read timeout issues I have encountered from time to time as well. Not sure what we can do about that.

The HTTP 504 error is an interesting one, I guess that one should trigger retries before bailing out. (Maybe that's already done. If so, it should say so too.)

@dagwieers dagwieers force-pushed the wst_test2 branch 3 times, most recently from 3749451 to d9786c5 Compare March 21, 2017 15:02
@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. labels Mar 21, 2017
@ansibot
Copy link
Contributor

ansibot commented Mar 21, 2017

The test ansible-test sanity --test yamllint failed with the following error:

test/integration/targets/win_scheduled_task/tasks/tests.yml:51:7: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Mar 21, 2017
@ansibot
Copy link
Contributor

ansibot commented Mar 21, 2017

The test ansible-test sanity --test yamllint failed with the following error:

test/integration/targets/win_scheduled_task/tasks/tests.yml:77:7: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@mattclay
Copy link
Member

mattclay commented Mar 21, 2017

CI failure in integration tests:

2017-03-21 16:35:00 ERROR! Syntax Error while loading YAML.
2017-03-21 16:35:00 
2017-03-21 16:35:00 
2017-03-21 16:35:00 The error appears to have been in '/root/src/github.com/ansible/ansible/test/integration/targets/win_scheduled_task/tasks/tests.yml': line 77, column 7, but may
2017-03-21 16:35:00 be elsewhere in the file depending on the exact syntax problem.
2017-03-21 16:35:00 
2017-03-21 16:35:00 The offending line appears to be:
2017-03-21 16:35:00 
2017-03-21 16:35:00     win_scheduled_task: *wst_present
2017-03-21 16:35:00       enabled: yes
2017-03-21 16:35:00       ^ here

This is likely due to the same issue reported by yamllint.

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Mar 21, 2017
@ryansb ryansb removed the needs_triage Needs a first human triage before being processed. label Mar 21, 2017
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Mar 21, 2017
@ansibot
Copy link
Contributor

ansibot commented Mar 21, 2017

The test ansible-test sanity --test yamllint failed with the following error:

test/integration/targets/win_scheduled_task/tasks/tests.yml:88:7: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@dagwieers dagwieers force-pushed the wst_test2 branch 2 times, most recently from c3d59b1 to e0186c1 Compare March 21, 2017 19:41
Updated as discussed in previous Test Working Group.
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Mar 21, 2017
@nitzmahone nitzmahone merged commit ef36d7d into ansible:devel Mar 24, 2017
nitzmahone pushed a commit that referenced this pull request Mar 24, 2017
Updated as discussed in previous Test Working Group.
(cherry picked from commit ef36d7d)
@nitzmahone
Copy link
Member

cherry-picked to stable-2.3

@dagwieers dagwieers added the windows Windows community label Feb 11, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 windows Windows community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants