)]}'
{"playbooks/devstack-tempest.yaml":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"b03e6978dc296e1a50e9faac46abe1a711f3b822","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        name: tempest-cleanup"},{"line_number":44,"context_line":"      vars:"},{"line_number":45,"context_line":"        dry_run: true"},{"line_number":46,"context_line":"      when: run_tempest_dry_cleanup is defined and run_tempest_dry_cleanup | bool"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    - name: Run tempest cleanup"},{"line_number":49,"context_line":"      include_role:"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"1f621f24_227c1eea","line":46,"range":{"start_line":46,"start_character":77,"end_line":46,"end_character":81},"updated":"2020-11-03 18:35:44.000000000","message":"I was thinking to run run_tempest_fail_if_leaked_resources alone also but later while seeing the testing patch scenario it is fine to run it with either dry run or actual cleanup. it will be nice to add the usage in README, added comment there.","commit_id":"4e1e07e240a5892bcf139edcca8d2f3c79ab83d7"}],"roles/tempest-cleanup/README.rst":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"b03e6978dc296e1a50e9faac46abe1a711f3b822","unresolved":false,"context_lines":[{"line_number":38,"context_line":"   When true, the role will fail if any leaked resources are detected."},{"line_number":39,"context_line":"   The detection is done via dry_run.json file which if contains any resources,"},{"line_number":40,"context_line":"   some must have been leaked. This can be also used to verify that tempest"},{"line_number":41,"context_line":"   cleanup was successful."}],"source_content_type":"text/x-rst","patch_set":12,"id":"1f621f24_62bbb671","line":41,"range":{"start_line":41,"start_character":25,"end_line":41,"end_character":26},"updated":"2020-11-03 18:35:44.000000000","message":"can you add here about the different scenario you are testing in https://review.opendev.org/#/c/746690/\n\nSomething like below:\n\n.. zuul:rolevar:: run_tempest_fail_if_leaked_resources\n   :default: false\n\n   When true, the role will fail if any leaked resources are detected.\n   The detection is done via dry_run.json file which if contains any resources,\n   some must have been leaked. This can be also used to verify that tempest\n   cleanup was successful.\n\n   Usage:\n   1. To check if tempest cleanup CLI clean all the leaked resources or not, set this flag true along with run_tempest_cleanup\n      run_tempest_cleanup: true\n      run_tempest_fail_if_leaked_resources: true\n\n   2. To check if tempest leak any resources or not, set this flag true along with run_tempest_dry_cleanup\n      run_tempest_dry_cleanup: true\n      run_tempest_fail_if_leaked_resources: true","commit_id":"4e1e07e240a5892bcf139edcca8d2f3c79ab83d7"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"1075f07ccf8021bbdaa14161143cd8afbf904eae","unresolved":false,"context_lines":[{"line_number":38,"context_line":"   When true, the role will fail if any leaked resources are detected."},{"line_number":39,"context_line":"   The detection is done via dry_run.json file which if contains any resources,"},{"line_number":40,"context_line":"   some must have been leaked. This can be also used to verify that tempest"},{"line_number":41,"context_line":"   cleanup was successful."}],"source_content_type":"text/x-rst","patch_set":12,"id":"1f621f24_59094c93","line":41,"range":{"start_line":41,"start_character":25,"end_line":41,"end_character":26},"in_reply_to":"1f621f24_62bbb671","updated":"2020-11-03 21:47:22.000000000","message":"good point, I\u0027ll add it here, however, I have to reword it a little to describe it from the role perspective - the description you mentioned is from devstack-tempest.yaml playbook perspective.","commit_id":"4e1e07e240a5892bcf139edcca8d2f3c79ab83d7"}],"roles/tempest-cleanup/tasks/main.yaml":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"37a9d5eb2b09908eacfb7f75f3ba2c940c408bba","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    - name: Cat dry_run.json"},{"line_number":18,"context_line":"      command: cat \"{{ devstack_base_dir }}/tempest/dry_run.json\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"- when:"},{"line_number":21,"context_line":"    - not dry_run"},{"line_number":22,"context_line":"    - not init_saved_state"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f6b1bfe_25c2b8ea","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":0},"updated":"2020-10-13 16:06:40.000000000","message":"here, if run_tempest_fail_if_leaked_resources is true and dry_run_checker fail then fail this task.","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"37a9d5eb2b09908eacfb7f75f3ba2c940c408bba","unresolved":false,"context_lines":[{"line_number":23,"context_line":"  block:"},{"line_number":24,"context_line":"    - name: Run tempest cleanup"},{"line_number":25,"context_line":"      become: yes"},{"line_number":26,"context_line":"      become_user: tempest"},{"line_number":27,"context_line":"      command: tox -evenv-tempest -- tempest cleanup --debug"},{"line_number":28,"context_line":"      args:"},{"line_number":29,"context_line":"        chdir: \"{{ devstack_base_dir }}/tempest\""}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f6b1bfe_05ab3c1d","line":26,"range":{"start_line":26,"start_character":25,"end_line":26,"end_character":26},"updated":"2020-10-13 16:06:40.000000000","message":"if run_tempest_fail_if_leaked_resources is True then run dry run and check dry_run_checker fail, if so then fail the tasks before proceeding the actual cleanup.","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"37a9d5eb2b09908eacfb7f75f3ba2c940c408bba","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    - run_tempest_fail_if_leaked_resources"},{"line_number":45,"context_line":"    - not init_saved_state"},{"line_number":46,"context_line":"  block:"},{"line_number":47,"context_line":"    # run dry run (if haven\u0027t already) to find potential leaked resources"},{"line_number":48,"context_line":"    - import_tasks: dry_run.yaml"},{"line_number":49,"context_line":"      when: not dry_run"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    - name: Fail if any resources are leaked"},{"line_number":52,"context_line":"      shell: |"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f6b1bfe_e5a8c078","line":49,"range":{"start_line":47,"start_character":0,"end_line":49,"end_character":23},"updated":"2020-10-13 16:06:40.000000000","message":"this will execute in the case of init_saved_state case also which is not required. \n\n  when:\n    - not dry_run\n    - not init_saved_state","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"b03e6978dc296e1a50e9faac46abe1a711f3b822","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    - run_tempest_fail_if_leaked_resources"},{"line_number":45,"context_line":"    - not init_saved_state"},{"line_number":46,"context_line":"  block:"},{"line_number":47,"context_line":"    # run dry run (if haven\u0027t already) to find potential leaked resources"},{"line_number":48,"context_line":"    - import_tasks: dry_run.yaml"},{"line_number":49,"context_line":"      when: not dry_run"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    - name: Fail if any resources are leaked"},{"line_number":52,"context_line":"      shell: |"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"1f621f24_22e09ecc","line":49,"range":{"start_line":47,"start_character":0,"end_line":49,"end_character":23},"in_reply_to":"5f681702_2d91f89a","updated":"2020-11-03 18:35:44.000000000","message":"i see, i missed that. looks good.","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"b33fe4b83dabe8ae7776c43c4d85f6ebc17cec75","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    - run_tempest_fail_if_leaked_resources"},{"line_number":45,"context_line":"    - not init_saved_state"},{"line_number":46,"context_line":"  block:"},{"line_number":47,"context_line":"    # run dry run (if haven\u0027t already) to find potential leaked resources"},{"line_number":48,"context_line":"    - import_tasks: dry_run.yaml"},{"line_number":49,"context_line":"      when: not dry_run"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    - name: Fail if any resources are leaked"},{"line_number":52,"context_line":"      shell: |"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5f681702_2d91f89a","line":49,"range":{"start_line":47,"start_character":0,"end_line":49,"end_character":23},"in_reply_to":"7f6b1bfe_e5a8c078","updated":"2020-10-23 09:23:00.000000000","message":"It won\u0027t, this task is in a block which won\u0027t be executed if init_saved_state is true, see L45","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"37a9d5eb2b09908eacfb7f75f3ba2c940c408bba","unresolved":false,"context_lines":[{"line_number":40,"context_line":"      args:"},{"line_number":41,"context_line":"        chdir: \"{{ devstack_base_dir }}/tempest\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"- when:"},{"line_number":44,"context_line":"    - run_tempest_fail_if_leaked_resources"},{"line_number":45,"context_line":"    - not init_saved_state"},{"line_number":46,"context_line":"  block:"},{"line_number":47,"context_line":"    # run dry run (if haven\u0027t already) to find potential leaked resources"},{"line_number":48,"context_line":"    - import_tasks: dry_run.yaml"},{"line_number":49,"context_line":"      when: not dry_run"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    - name: Fail if any resources are leaked"},{"line_number":52,"context_line":"      shell: |"},{"line_number":53,"context_line":"        python roles/tempest-cleanup/tasks/dry_run_checker.py --file {{ devstack_base_dir }}/tempest/dry_run.json --is-empty"},{"line_number":54,"context_line":"      args:"},{"line_number":55,"context_line":"        chdir: \"{{ devstack_base_dir }}/tempest\""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f6b1bfe_c58784b6","line":55,"range":{"start_line":43,"start_character":0,"end_line":55,"end_character":48},"updated":"2020-10-13 16:06:40.000000000","message":"my idea behind this new flag[1] was if in case of dry run or actual cleanup if this flag is set to True then, fail the job.I am commenting above where we can fail this task based on this flag.\n\n[1] https://etherpad.opendev.org/p/qa-victoria-ptg","commit_id":"58c13cc3f690c8505b77c4e8b412c4efc7c1f0f2"}]}
