RedHatQE / teflo

Teflo is a standalone orchestration software that controls the flow of a set of testing scenarios, allowing users to provision machines, deploy software, execute tests against them and manage generated artifacts and report results.
https://teflo.readthedocs.io/en/latest/
GNU General Public License v3.0
14 stars 16 forks source link

CCITCARBON-405 Error presented is incorrect #201

Closed shay6 closed 2 years ago

shay6 commented 2 years ago

Hey, @jbpratt. I would like to share the fix with you. If you see any problem please let me know, thanks!

This is the output using the new changes.

(teflo_env) shshevac@ bash$~/work/run_teflo/tkt_405$ teflo run -t provision -t orchestrate -s sdf_playbook.yml 
--------------------------------------------------
Teflo Framework v2.2.2
Copyright (C) 2021, Red Hat, Inc.
--------------------------------------------------
2022-02-22 13:00:05,511 WARNING Scenario workspace was not set, therefore the workspace is automatically assigned to the current working directory. You may experience problems if files needed by teflo do not exists in the scenario workspace.
2022-02-22 13:00:05,566 INFO 

2022-02-22 13:00:05,567 INFO                                TEFLO RUN (START)                               
2022-02-22 13:00:05,568 INFO -------------------------------------------------------------------------------
2022-02-22 13:00:05,569 INFO  * Data Folder           : /tmp/8xblgvy2nx
2022-02-22 13:00:05,570 INFO  * Workspace             : /home/shshevac/work/run_teflo/tkt_405
2022-02-22 13:00:05,571 INFO  * Log Level             : info
2022-02-22 13:00:05,572 INFO  * Tasks                 : ['provision', 'orchestrate']
2022-02-22 13:00:05,574 INFO  * Iterate Method        : by_level
2022-02-22 13:00:05,575 INFO  * Scenario              : test
2022-02-22 13:00:05,576 INFO -------------------------------------------------------------------------------

2022-02-22 13:00:05,577 INFO ..................................................
2022-02-22 13:00:05,577 INFO 'test' is running from the scenario file: sdf_playbook.yml
2022-02-22 13:00:05,579 INFO ..................................................
2022-02-22 13:00:05,581 INFO Sending out any notifications that are registered.
2022-02-22 13:00:05,582 INFO ..................................................
2022-02-22 13:00:05,583 INFO Starting tasks on pipeline: notify
2022-02-22 13:00:05,584 WARNING ... no tasks to be executed ...
2022-02-22 13:00:05,584 INFO  * Task    : provision
2022-02-22 13:00:05,586 INFO ..................................................
2022-02-22 13:00:05,587 INFO Starting tasks on pipeline: provision
2022-02-22 13:00:05,588 INFO --> Blaster v0.5.0 <--
2022-02-22 13:00:05,589 INFO Task Execution: Concurrent
2022-02-22 13:00:05,592 INFO Tasks:
2022-02-22 13:00:05,593 INFO 1. Task     : driver
                                Class    : <class 'teflo.tasks.provision.ProvisionTask'>
                                Methods  : ['run']
2022-02-22 13:00:05,594 INFO ** BLASTER BEGIN **
2022-02-22 13:00:05,621 WARNING Asset driver is static, provision will be skipped.
2022-02-22 13:00:05,626 INFO ** BLASTER COMPLETE **
2022-02-22 13:00:05,628 INFO     -> TOTAL DURATION: 0h:0m:0s
2022-02-22 13:00:05,631 INFO Populating inventory file with host(s) driver
2022-02-22 13:00:05,636 INFO ..................................................
2022-02-22 13:00:05,637 INFO  * Task    : orchestrate
2022-02-22 13:00:05,639 INFO ..................................................
2022-02-22 13:00:05,640 INFO Starting tasks on pipeline: orchestrate
2022-02-22 13:00:05,641 INFO --> Blaster v0.5.0 <--
2022-02-22 13:00:05,643 INFO Task Execution: Sequential
2022-02-22 13:00:05,647 INFO Tasks:
2022-02-22 13:00:05,649 INFO 1. Task     : test
                                Class    : <class 'teflo.tasks.orchestrate.OrchestrateTask'>
                                Methods  : ['run']
2022-02-22 13:00:05,651 INFO ** BLASTER BEGIN **
2022-02-22 13:00:05,656 INFO    running orchestration test for ['driver']
2022-02-22 13:00:05,661 INFO Executing playbook:
2022-02-22 13:00:05,662 INFO Ansible options used: {}
2022-02-22 13:00:05,662 INFO Executing playbook : /home/shshevac/work/run_teflo/tkt_405/site.yml
2022-02-22 13:00:05,690 INFO 127.0.0.1
2022-02-22 13:00:06,519 INFO 
2022-02-22 13:00:06,520 INFO PLAY [Test] ********************************************************************
2022-02-22 13:00:06,533 INFO 
2022-02-22 13:00:06,533 INFO TASK [Gathering Facts] *********************************************************
2022-02-22 13:00:08,109 INFO ok: [127.0.0.1]
2022-02-22 13:00:08,152 INFO 
2022-02-22 13:00:08,153 INFO TASK [Demo fail] ***************************************************************
2022-02-22 13:00:10,238 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (5 retries left).
2022-02-22 13:00:12,894 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (4 retries left).
2022-02-22 13:00:15,365 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (3 retries left).
2022-02-22 13:00:17,745 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (2 retries left).
2022-02-22 13:00:20,157 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (1 retries left).
2022-02-22 13:00:23,036 INFO fatal: [127.0.0.1]: FAILED! => {"access_control_allow_credentials": "true", "access_control_allow_origin": "*", "attempts": 5, "changed": false, "connection": "close", "content_length": "233", "content_type": "text/html", "date": "Tue, 22 Feb 2022 11:00:22 GMT", "elapsed": 1, "failed_when_result": true, "msg": "Status code was 404 and not [200]: HTTP Error 404: NOT FOUND", "redirected": false, "server": "gunicorn/19.9.0", "status": 404, "url": "https://httpbin.org/test"}
2022-02-22 13:00:23,039 INFO 
2022-02-22 13:00:23,039 INFO PLAY RECAP *********************************************************************
2022-02-22 13:00:23,039 INFO 127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
2022-02-22 13:00:23,039 INFO 
2022-02-22 13:00:23,175 WARNING During the failure these messages were thrown as a part of stderr:
 [WARNING]: Found variable using reserved name: hosts

2022-02-22 13:00:23,177 ERROR Orchestration failed : Playbook /home/shshevac/work/run_teflo/tkt_405/site.yml failed to run.
Please look at the scenario log for ansible failure.
2022-02-22 13:00:23,305 ERROR Failed to run orchestration test 
2022-02-22 13:00:23,306 ERROR Orchestration failed : Failed to perform  test
2022-02-22 13:00:23,307 ERROR A exception was raised while processing task: test method: run
Traceback (most recent call last):
  File "/home/shshevac/.virtualenvs/teflo_env/lib/python3.8/site-packages/blaster/blast.py", line 83, in run
    value = getattr(task_obj, method)()
  File "/home/shshevac/work/teflo/teflo/tasks/orchestrate.py", line 59, in run
    self.orchestrator.run()
  File "/home/shshevac/work/teflo/teflo/orchestrators/action_orchestrator.py", line 68, in run
    raise TefloOrchestratorError("Orchestration failed : Failed to perform  %s" % self.plugin.action_name)
teflo.exceptions.TefloOrchestratorError: Orchestration failed : Failed to perform  test
2022-02-22 13:00:24,309 INFO ** BLASTER COMPLETE **
2022-02-22 13:00:24,309 INFO     -> TOTAL DURATION: 0h:0m:18s
2022-02-22 13:00:24,310 ERROR One or more tasks got a status of non zero.
2022-02-22 13:00:24,311 INFO Sending out any notifications that are registered.
2022-02-22 13:00:24,312 INFO ..................................................
2022-02-22 13:00:24,313 INFO Starting tasks on pipeline: notify
2022-02-22 13:00:24,313 WARNING ... no tasks to be executed ...
2022-02-22 13:00:24,314 ERROR Scenario `test` failed during the Teflo run
2022-02-22 13:00:24,337 INFO 

2022-02-22 13:00:24,338 INFO                                SCENARIO RUN (END)                              
2022-02-22 13:00:24,338 INFO -------------------------------------------------------------------------------
2022-02-22 13:00:24,339 INFO  * Duration                       : 0h:0m:18s
2022-02-22 13:00:24,341 INFO  * Passed Tasks                   : ['provision']
2022-02-22 13:00:24,342 INFO  * Failed Tasks                   : ['orchestrate']
2022-02-22 13:00:24,344 INFO  * Results Folder                 : /tmp/.results
2022-02-22 13:00:24,345 INFO  * Iterate Method                 : by_level
2022-02-22 13:00:24,345 INFO  * Scenario Definition            : test
2022-02-22 13:00:24,346 INFO  * Final Scenario Definition      : /tmp/.results/results.yml
2022-02-22 13:00:24,346 INFO -------------------------------------------------------------------------------
2022-02-22 13:00:24,346 INFO TEFLO RUN (RESULT=FAILED)
(teflo_env) shshevac@1 bash$~/work/run_teflo/tkt_405$ 

The main part is here:

2022-02-22 13:00:08,153 INFO TASK [Demo fail] ***************************************************************
2022-02-22 13:00:10,238 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (5 retries left).
2022-02-22 13:00:12,894 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (4 retries left).
2022-02-22 13:00:15,365 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (3 retries left).
2022-02-22 13:00:17,745 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (2 retries left).
2022-02-22 13:00:20,157 INFO FAILED - RETRYING: [127.0.0.1]: Demo fail (1 retries left).
2022-02-22 13:00:23,036 INFO fatal: [127.0.0.1]: FAILED! => {"access_control_allow_credentials": "true", "access_control_allow_origin": "*", "attempts": 5, "changed": false, "connection": "close", "content_length": "233", "content_type": "text/html", "date": "Tue, 22 Feb 2022 11:00:22 GMT", "elapsed": 1, "failed_when_result": true, "msg": "Status code was 404 and not [200]: HTTP Error 404: NOT FOUND", "redirected": false, "server": "gunicorn/19.9.0", "status": 404, "url": "https://httpbin.org/test"}
2022-02-22 13:00:23,039 INFO 
2022-02-22 13:00:23,039 INFO PLAY RECAP *********************************************************************
2022-02-22 13:00:23,039 INFO 127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
2022-02-22 13:00:23,039 INFO 
2022-02-22 13:00:23,175 WARNING During the failure these messages were thrown as a part of stderr:
 [WARNING]: Found variable using reserved name: hosts

2022-02-22 13:00:23,177 ERROR Orchestration failed : Playbook /home/shshevac/work/run_teflo/tkt_405/site.yml failed to run.
Please look at the scenario log for ansible failure.
2022-02-22 13:00:23,305 ERROR Failed to run orchestration test 
2022-02-22 13:00:23,306 ERROR Orchestration failed : Failed to perform  test
2022-02-22 13:00:23,307 ERROR A exception was raised while processing task: test method: run
Traceback (most recent call last):
  File "/home/shshevac/.virtualenvs/teflo_env/lib/python3.8/site-packages/blaster/blast.py", line 83, in run
    value = getattr(task_obj, method)()
  File "/home/shshevac/work/teflo/teflo/tasks/orchestrate.py", line 59, in run
    self.orchestrator.run()
  File "/home/shshevac/work/teflo/teflo/orchestrators/action_orchestrator.py", line 68, in run
    raise TefloOrchestratorError("Orchestration failed : Failed to perform  %s" % self.plugin.action_name)
teflo.exceptions.TefloOrchestratorError: Orchestration failed : Failed to perform  test
2022-02-22 13:00:24,309 INFO ** BLASTER COMPLETE **
2022-02-22 13:00:24,309 INFO     -> TOTAL DURATION: 0h:0m:18s
jbpratt commented 2 years ago

Hi @shay6 , thanks for your work on this. The changes look good to me!

shay6 commented 2 years ago

thanks, @JunqiZhang0 need at least one approval to merge it https://github.com/RedHatQE/teflo/pull/203