[Breaking] Fix issue where we have duplicate packages in tests #301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we build tests that aren't external, we have two versions for the package under test:
go_library()
target that we're trying to test_{name}#lib
package that re-compiles that package with all the test sourcesBefore we would have two different import paths for these two versions of the package. They're both available in the test binary, where the test version of the package is available as
import "{name}_test_lib"
.This causes a bunch of problems and confusion:
There are a few cases internally where a non-exported test imports the non-test version of the package to avoid type conflicts between the two versions of the packages.
This PR links the test version of the package into the binary, with the same import path as the prod version. This means there's no distinction.
TODO gate this behind a feature flag.