goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.55k stars 473 forks source link

option reable for molecule test #725

Closed spham closed 1 year ago

spham commented 2 years ago

hi today when have error, in molecule and ansible. we have report unreadable, like this.

image

why not have something like this ? image

it should improve debug and DX experience

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

petemounce commented 2 years ago

@spham when I use ansible I am unsatisfied with its default output too.

I tried a few options and then went with the YAML output option. https://www.jeffgeerling.com/blog/2018/use-ansibles-yaml-callback-plugin-better-cli-experience illustrates.

I thought that was a very acceptable experience for me. What do you think?

spham commented 2 years ago

thanks you

spham commented 2 years ago

when I try with ansible.cfg in same project

i have this issue, it request a password for tests

[defaults]
# Use the YAML callback plugin.
stdout_callback = yaml
# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
failed: [] (item=/home/elk/roles/tests/templates/elastic.j2) => changed=false 
  ansible_loop_var: item
  item: /home/elk/roles/tests/templates/elastic.j2
  module_stderr: |-
    Shared connection to 172.25.192.122 closed.
  module_stdout: |-
    sudo: il est ncessaire de saisir un mot de passe
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
petemounce commented 2 years ago

That looks like the output format has changed to YAML as expected; is that correct?

The error seems to relate to either a dropped connection to that IP, or something in a language I don't know relating to sudo. Have you inspected the stdout/stderr as the error text suggests?

(I think we're into ansible playbook debugging here, not Goss...?)

ripienaar commented 2 years ago

Sudo is trying to prompt for a password but cant without a tty, its a sudo setup issue imo

berney commented 1 year ago

Can this issue be closed?

petemounce commented 1 year ago

I think this is closeable. Please ping back if there's something further?