Skip to content

Refactor main unit-tests by leveraging testing.F.Cleanup #179

@jlvoiseux

Description

@jlvoiseux

As mentioned in #169, as an alternative to having a testify suite which sets up all the things, we should consider making smaller, more targeted functions which use testing.F.Cleanup to clean up on test completion.

e.g.

func newMockLambdaServer(t testing.TB) *http.Server {
    lambdaServer := ...
    t.Cleanup(lambdaServer.Close)
    return lambdaServer
}

func newMockAPMServer(t testing.TB) (*http.Server, *apmServerInternals) {
    ...
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions