Skip to content

Sometimes miscounts tests #2

@anonymouse64

Description

@anonymouse64

Maybe just when used with go-check ?

$ goctest ./gadget/
× …/gadget
Found 1 test in 1 package.
0 tests passed, and 1 tests failed.
 ⡔⣢ ⠶⡜   ⣰⡀ ⢀⡀ ⢀⣀ ⣰⡀ ⢀⣀   ⣀⡀ ⢀⣀ ⢀⣀ ⢀⣀ ⢀⡀ ⢀⣸  
 ⠫⠜ ⡜⠶   ⠘⠤ ⠣⠭ ⠭⠕ ⠘⠤ ⠭⠕   ⡧⠜ ⠣⠼ ⠭⠕ ⠭⠕ ⠣⠭ ⠣⠼ ⠶

Are you even trying?

=== RUN   TestRun

----------------------------------------------------------------------
FAIL: gadget_test.go:2049: gadgetYamlTestSuite.TestLaidOutVolumesFromGadgetMultiVolume

gadget_test.go:2058:
    c.Assert(all["u-boot-frobinator"].LaidOutStructure, DeepEquals, []gadget.LaidOutStructure{
        {
            VolumeStructure: &gadget.VolumeStructure{
                VolumeName: "u-boot-frobinator",
                Name:       "u-boot",
                Offset:     nil,
            },
            StartOffset: 0,
        },
    })
... obtained []gadget.LaidOutStructure = []gadget.LaidOutStructure{gadget.LaidOutStructure{VolumeStructure:(*gadget.VolumeStructure)(0xc0002d4600), StartOffset:0x0, AbsoluteOffsetWrite:(*quantity.Offset)(nil), Index:0, LaidOutContent:[]gadget.LaidOutContent(nil), ResolvedContent:[]gadget.ResolvedContent(nil)}}
... expected []gadget.LaidOutStructure = []gadget.LaidOutStructure{gadget.LaidOutStructure{VolumeStructure:(*gadget.VolumeStructure)(0xc0002d4780), StartOffset:0x0, AbsoluteOffsetWrite:(*quantity.Offset)(nil), Index:0, LaidOutContent:[]gadget.LaidOutContent(nil), ResolvedContent:[]gadget.ResolvedContent(nil)}}
... Difference:
...     [0].VolumeStructure.Offset: &quantity.Offset(0x0) != nil
...     [0].VolumeStructure.Size: 623000 != 0
...     [0].VolumeStructure.Type: "bare" != ""


OOPS: 261 passed, 1 FAILED
--- FAIL: TestRun (2.64s)

I can see that there wasn't 1 test ran, there was actually 262 tests, of which only 1 failed, but the message says that only 1 test was found in the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions