Closed apostasie closed 2 months ago
Besides bugs in our testing tools - hopefully got fixed by now - laying out issues here with the current design, that should inform a proposal to enhance:
defer
instead of t.Cleanup
- cleaning up should be taken care of automaticallytID := testutil.Identifier()
) - since all tests are doing it, that should be hidden awaybase.Cmd
) is left as an exercise to the developer, leading to all of the issues above (Chdir, Env manipulation, no debugging output, etc)
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