[TE-6238] Prepend and trim location prefix when split by selector#575
Draft
nprizal wants to merge 1 commit into
Draft
[TE-6238] Prepend and trim location prefix when split by selector#575nprizal wants to merge 1 commit into
nprizal wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is a spike for one of the options we're weighing for how location prefix should interact with selector based splitting (see Context). Specifically, it's what
bktecneeds to look like under the option wheretest.selector.primaryincludes the location prefix.Right now, selector based splitting sends discovered test targets straight to the Test Plan API as raw selectors, with no location prefix applied. If ingestion ends up setting
test.selector.primarywith the prefix included, our selector won't match what's stored, and the test plan will come back with no historical duration.This PR makes
bktecprepend the location prefix to a selector before sending it, but only when the selector is actually a file path (e.g. Rspec). Some runners use selectors that aren't file paths at all (e.g. Go package names), so we check withos.Statfirst and leave those untouched.I also fixed
trimTaskLocationPrefixinrun.go, which previously skipped selector-format tests entirely when trimming the prefix from the plan we get back. Now it trims the prefix fromtest.Valuefor those too, so the runner gets a selector it can actually use.Context
We hit this while testing selector based splitting for rspec in
buildkite/buildkite(build) and the plan came back with no historical duration.We're still deciding how ingestion should set
test.selector.primarywhen location prefix is configured: leave the prefix out, or include it. This PR is a spike for whatbkteclooks like if we go with including it. Wrote up the full problem in this doc if you want more background.Linear: TE-6238
Testing
Covered by unit tests.