Skip to content

ctr_test.go routes all test cases through runForegroundTest, silently ignoring TestFunc #68

@mdryaan

Description

@mdryaan

Description

tests/e2e/ctr_test.go (line 46–53) uses toTableEntries(ctrTestCases()) directly inside a single DescribeTable, routing every test case through runForegroundTest. runForegroundTest checks ExpectOut — it never calls TestFunc. Any test case in ctrTestCases() that sets a non-nil TestFunc (such as pingTest or userGroupTest) will have that function silently ignored.

In contrast, tests/e2e/nerdctl_test.go (line 46–66) correctly splits cases into foreground and detached groups using selectTestCases(nerdctlTestCases(), false) and selectTestCases(nerdctlTestCases(), true).

Currently all ctrTestCases() entries use matchTest (which is nil by Go zero-value semantics), so the bug is latent. But as ctr test cases expand to include ping or user/group tests, they will silently pass without actually running the intended test function.

Expected behavior: ctr_test.go should mirror nerdctl_test.go: cases with a nil TestFunc run as foreground tests, and cases with a non-nil TestFunc run as detached tests.

Current behavior: All ctr test cases are unconditionally sent to runForegroundTest.

Proposed fix: Wrap the existing DescribeTable in a Context("foreground containers") block using selectTestCases(ctrTestCases(), false), and add a second Context("detached containers") block using selectTestCases(ctrTestCases(), true) that calls runDetachedTest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions