atomic-host-tests icon indicating copy to clipboard operation
atomic-host-tests copied to clipboard

Skip test without failing if docker-latest is not installed

Open mike-nguyen opened this issue 7 years ago • 2 comments

The docker test has been failing in a couple of streams because docker-latest is intentionally removed. Ideally the test should be skipped and not report a failure, however Ansible is not very straight forward.

I found meta: end_play that can conditionally end the play without failing. The caveat is that that it needs to be run in every play. In the docker test there is only two or three test so its not that bad. Any thoughts on this?

Before:

PLAY [Docker - Setup] **********************************************************

TASK [setup] *******************************************************************
ok: [rhelah]

TASK [Check for docker-latest package if running against docker-latest] ********
changed: [rhelah] => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
 [WARNING]: Consider using yum, dnf or zypper module rather than running rpm


TASK [Fail if docker latest is not installed] **********************************
fatal: [rhelah]: FAILED! => {
    "changed": false, 
    "failed": true
}

MSG:
---
This test is not valid because docker-latest is not installed
---
PLAY RECAP *********************************************************************
rhelah                     : ok=2    changed=1    unreachable=0    failed=1   

After:

PLAY [Docker - Setup] **********************************************************

TASK [setup] *******************************************************************
ok: [rhelah]

TASK [Check for docker-latest package if running against docker-latest] ********
changed: [rhelah] => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
 [WARNING]: Consider using yum, dnf or zypper module rather than running rpm


TASK [set not_installed] *******************************************************
ok: [rhelah] => {
    "ansible_facts": {
        "not_installed": true
    }, 
    "changed": false
}

PLAY [Docker - Functional Tests] ***********************************************

TASK [setup] *******************************************************************
ok: [rhelah]

PLAY [Docker - Cleanup] ********************************************************

TASK [setup] *******************************************************************
ok: [rhelah]

PLAY RECAP *********************************************************************
rhelah                     : ok=5    changed=1    unreachable=0    failed=0   

mike-nguyen avatar Jan 18 '18 14:01 mike-nguyen

This is not a bad idea, but I think we should be able to control which tests are executed at the job level.

Let's leave this open for now as we think about our options.

miabbott avatar Jan 18 '18 16:01 miabbott

For the time being, I've configured our internal Jenkins jobs to use -e g_docker_latest=false on the Fedora streams.

miabbott avatar Feb 08 '18 14:02 miabbott