Skip to content

mock: Remove or Disable logging output in mock.AssertExpectations #1358

@hikyaru-suzuki

Description

@hikyaru-suzuki

I am looking to remove the log output from mock.AssertExpectations runs. There have been several similar issues before (#782, #414) and the reason I want to remove them is similar to these. I am currently using gomock, but am considering moving to testify/mock, which supports generics, and these outputs themselves can be a bottleneck in testing large repositories where I have more than 10,000 test cases to deal with.
I am thinking of submitting a Pull Request, especially since there seems to be no progress. However, I am not familiar with this repository and am not sure whether to keep backward compatibility or not.
If you don't need backward compatibility, this is a very easy job. Simply remove or disable the following line:

t.Logf(reason)

Conversely, if backward compatibility is required, I don't know how to implement this, but there are several options, such as defining a public function in the testify/mock package to disable logging, or providing an environment variable to prevent logging from being output. I would love to hear your ideas!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpkg-mockAny issues related to Mock

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions