Add bundle debug fetch-repository-info, cover it locally and on cloud - #6265
Open
denik wants to merge 1 commit into
Open
Add bundle debug fetch-repository-info, cover it locally and on cloud#6265denik wants to merge 1 commit into
denik wants to merge 1 commit into
Conversation
git.FetchRepositoryInfo had no test that runs without a workspace, and no unit test at all. Add a hidden `bundle debug fetch-repository-info` that calls it directly and prints the result, so the local-.git path can be exercised through the CLI both against the fake server and on a real workspace. The acceptance test covers what the deleted integration tests asserted: a git worktree (from the root and a subdirectory), a directory that is not a repository, a path that does not exist, and a .git that is a file rather than a directory. The API path (/Workspace + DBR) is unchanged and its integration tests stay: reaching it needs a real /databricks directory, which a subprocess cannot fake. Co-authored-by: Isaac
Contributor
Approval status: pending
|
Collaborator
Integration test reportCommit: 25f9469
11 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 1 KNOWN
Top 3 slowest tests (at least 2 minutes):
|
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.
Add a hidden
bundle debug fetch-repository-infothat callsgit.FetchRepositoryInfodirectly, cover the local-.gitpath with an acceptance test that runs both locally and on cloud, and delete the three integration tests that covered it.Previous PRs in this series: #6113, #6140, #6223, #6236
Why
FetchRepositoryInfohas no unit test and, until now, no test that runs without a workspace. It is a library function with no direct CLI surface, so the only way to reach it from an acceptance test was throughbundle validate, which does not let a test point it at an arbitrary path. The debug command gives it a surface, so the same test runs against the fake server and against a real workspace.TestFetchRepositoryInfoDotGit_*never used the workspace client they asked for: the API branch is taken only for a/Workspace/path on DBR (libs/git/info.go:52), and they all passt.TempDir()paths. They were paying for a workspace to test local filesystem behaviour.The acceptance test covers what they asserted: a git worktree (from the root and from a subdirectory), a directory that is not a repository, a path that does not exist, and a
.gitthat is a file rather than a directory.The API path is unchanged
TestFetchRepositoryInfoAPI_*stay. Reaching that branch needsdbr.RunsOnRuntime, which requires Linux,DATABRICKS_RUNTIME_VERSION, and a real/databricksdirectory (libs/dbr/detect.go:16-38). A subprocess cannot fake the directory, so an acceptance test cannot take that branch outside the existing DBR harness.