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/testify@v1.10.0/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