Skip to content

some output is not processed correctly #42

@trim21

Description

@trim21

I ran by test with default go test ./... command and it output like this:

...
ok      github.com/bangumi/server/pkg/wiki      (cached)
ok      github.com/bangumi/server/revision      (cached)
ok      github.com/bangumi/server/subject       (cached)
ok      github.com/bangumi/server/user  (cached)
?       github.com/bangumi/server/web   [no test files]
?       github.com/bangumi/server/web/captcha   [no test files]
?       github.com/bangumi/server/web/captcha/hcaptcha  [no test files]
...

Then I add -json flags and pipe to gotestfmt with command go test -json ./... 2>&1 | tee test.log | .bin/gotestfmt -hide empty-packages,successful-tests

sometimes there are extra output shows:

...

📦 github.com/bangumi/server/person
ok      github.com/bangumi/server/person        (cached)
  🚧 TestGet (0s)
  🚧 TestMysqlRepo_GetByIDs (0s)
  🚧 TestMysqlRepo_GetSubjectRelated (0s)

📦 github.com/bangumi/server/pkg/duration

📦 github.com/bangumi/server/web/session
ok      github.com/bangumi/server/web/session   (cached)
  🚧 TestManager_Get_notfound (0s)
  🚧 TestMysqlRepo_Create (0s)
  🚧 TestMysqlRepo_Create_conflict (0s)
  🚧 TestMysqlRepo_Get_ok (0s)
  🚧 TestMysqlRepo_Revoke (0s)
...

these lines ok github.com/bangumi/server/web/rate (cached) will show randomly on random packages. I have no idea why they show up.

and you can always re-produce this with certain test output.

I check the raw test output, these lines are included in all packages but only some of them are not processed as expected.

complete output as test cases are attached here.

log.zip

My gotestfmt binary is build from version v2.3.1 with go build -o .bin/gotestfmt github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt, which is the latest version currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions