Skip to content

testutil helpers are hard to use and make too many assumptions on command outcomes #3130

@apostasie

Description

@apostasie

Description

Specifically, some helpers testing stdout do first assert that exit code == 0.

However, there are legitimate cases where exit code is not 0 and you still want to test the output.

Recently, we also faced issues with commands being executed multiple times as each helper invocation used to call Run again.

In light of these issues, maybe it will soon be time to have a look at type Cmd and possibly revamp it to make testing easier.

Steps to reproduce the issue

na

Describe the results you received and expected

na

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions