Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Skip test without failing if docker-latest is not installed #320

Open
mike-nguyen opened this issue Jan 18, 2018 · 2 comments
Open

Skip test without failing if docker-latest is not installed #320

mike-nguyen opened this issue Jan 18, 2018 · 2 comments

Comments

@mike-nguyen
Copy link
Collaborator

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   
@miabbott
Copy link
Collaborator

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
Copy link
Collaborator

miabbott commented Feb 8, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants