@@ -50,7 +50,16 @@ func TestEnsureCommand_DisabledPerToolset(t *testing.T) {
5050 }
5151}
5252
53- func TestEnsureCommand_SoftFail (t * testing.T ) {
53+ func TestEnsureCommand_AutoDetectFailureFallsBackToOriginalCommand (t * testing.T ) {
54+ t .Setenv ("DOCKER_AGENT_TOOLS_DIR" , t .TempDir ())
55+ t .Setenv ("DOCKER_AGENT_AUTO_INSTALL" , "" )
56+
57+ result , err := EnsureCommand (t .Context (), "nonexistent-tool" , "" )
58+ require .NoError (t , err )
59+ assert .Equal (t , "nonexistent-tool" , result )
60+ }
61+
62+ func TestEnsureCommand_ExplicitVersionFailureStillErrors (t * testing.T ) {
5463 t .Setenv ("DOCKER_AGENT_TOOLS_DIR" , t .TempDir ())
5564 t .Setenv ("DOCKER_AGENT_AUTO_INSTALL" , "" )
5665
@@ -73,7 +82,7 @@ func TestEnsureCommand_FoundInBinDir(t *testing.T) {
7382 assert .Equal (t , fakeBin , result )
7483}
7584
76- func TestEnsureCommand_NonExecutableInBinDirIsSkipped (t * testing.T ) {
85+ func TestEnsureCommand_NonExecutableInBinDirFallsBackToOriginalCommand (t * testing.T ) {
7786 toolsDir := t .TempDir ()
7887 t .Setenv ("DOCKER_AGENT_TOOLS_DIR" , toolsDir )
7988 t .Setenv ("DOCKER_AGENT_AUTO_INSTALL" , "" )
@@ -82,9 +91,9 @@ func TestEnsureCommand_NonExecutableInBinDirIsSkipped(t *testing.T) {
8291 require .NoError (t , os .MkdirAll (binDir , 0o755 ))
8392 require .NoError (t , os .WriteFile (filepath .Join (binDir , "not-executable" ), []byte ("data" ), 0o644 ))
8493
85- // Falls through to auto-install → fails → returns error.
86- _ , err := EnsureCommand ( t . Context (), "not-executable" , "" )
87- require . Error (t , err )
94+ result , err := EnsureCommand ( t . Context (), "not-executable" , "" )
95+ require . NoError ( t , err )
96+ assert . Equal (t , "not-executable" , result )
8897}
8998
9099// --- resolve tests ---
0 commit comments