Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update depguard rules to prevent importing test code outside tests
There is a lot of shared test code defined outside of _test.go files scattered through out the code base. Dead code detection in Go is not that great and cannot detect that these test helpers are only consumed in tests. This results in testify code being included in production binaries: ```bash strings build/teleport | rg testify github.com/stretchr/testify/assert.init github.com/stretchr/testify/assert.uint32Type go:link.pkghashbytes.github.com/stretchr/testify/assert github.com/stretchr/testify/assert.int64Type github.com/stretchr/testify/assert.uintptrType go:link.pkghashbytes.github.com/stretchr/testify/require github.com/stretchr/testify/assert.stringType github.com/stretchr/testify/assert.float32Type github.com/stretchr/testify/assert.bytesType github.com/stretchr/testify/assert.intType go:link.pkghashbytes.github.com/stretchr/testify/assert/yaml github.com/stretchr/testify/assert.float64Type github.com/stretchr/testify/assert..inittask github.com/stretchr/testify/assert.int32Type github.com/stretchr/testify/assert.uint16Type github.com/stretchr/testify/assert.int8Type github.com/stretchr/testify/assert.uint64Type github.com/stretchr/testify/assert.uintType github.com/stretchr/testify/assert.uint8Type go:link.pkghash.github.com/stretchr/testify/assert/yaml github.com/stretchr/testify/assert.int16Type go:link.pkghash.github.com/stretchr/testify/require go:link.pkghash.github.com/stretchr/testify/assert github.com/stretchr/testify/assert.timeType dep github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify/assert.init github.com/stretchr/[email protected]/assert/assertion_compare.go dep github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= ``` While this doesn't remediate anything, it should hopeful avoid any future code from making it harder to separate test and production code.
- Loading branch information