@@ -11,23 +11,23 @@ import (
1111)
1212
1313func TestGetConfigDir (t * testing.T ) {
14- dir , err := GetConfigDir ()
14+ dir , err := GetConfigDir (t . Context () )
1515 assert .NoError (t , err )
1616 assert .Contains (t , dir , filepath .Join (".databricks" , "ssh-tunnel-configs" ))
1717}
1818
1919func TestGetMainConfigPath (t * testing.T ) {
20- path , err := GetMainConfigPath ()
20+ path , err := GetMainConfigPath (t . Context () )
2121 assert .NoError (t , err )
2222 assert .Contains (t , path , filepath .Join (".ssh" , "config" ))
2323}
2424
2525func TestGetMainConfigPathOrDefault (t * testing.T ) {
26- path , err := GetMainConfigPathOrDefault ("/custom/path" )
26+ path , err := GetMainConfigPathOrDefault (t . Context (), "/custom/path" )
2727 assert .NoError (t , err )
2828 assert .Equal (t , "/custom/path" , path )
2929
30- path , err = GetMainConfigPathOrDefault ("" )
30+ path , err = GetMainConfigPathOrDefault (t . Context (), "" )
3131 assert .NoError (t , err )
3232 assert .Contains (t , path , filepath .Join (".ssh" , "config" ))
3333}
@@ -58,7 +58,7 @@ func TestEnsureIncludeDirective_NewConfig(t *testing.T) {
5858 t .Setenv ("HOME" , tmpDir )
5959 t .Setenv ("USERPROFILE" , tmpDir )
6060
61- err := EnsureIncludeDirective (configPath )
61+ err := EnsureIncludeDirective (t . Context (), configPath )
6262 assert .NoError (t , err )
6363
6464 content , err := os .ReadFile (configPath )
@@ -77,7 +77,7 @@ func TestEnsureIncludeDirective_AlreadyExists(t *testing.T) {
7777
7878 configPath := filepath .Join (tmpDir , ".ssh" , "config" )
7979
80- configDir , err := GetConfigDir ()
80+ configDir , err := GetConfigDir (t . Context () )
8181 require .NoError (t , err )
8282
8383 // Use forward slashes as that's what SSH config uses
@@ -88,7 +88,7 @@ func TestEnsureIncludeDirective_AlreadyExists(t *testing.T) {
8888 err = os .WriteFile (configPath , []byte (existingContent ), 0o600 )
8989 require .NoError (t , err )
9090
91- err = EnsureIncludeDirective (configPath )
91+ err = EnsureIncludeDirective (t . Context (), configPath )
9292 assert .NoError (t , err )
9393
9494 content , err := os .ReadFile (configPath )
@@ -110,7 +110,7 @@ func TestEnsureIncludeDirective_PrependsToExisting(t *testing.T) {
110110 err = os .WriteFile (configPath , []byte (existingContent ), 0o600 )
111111 require .NoError (t , err )
112112
113- err = EnsureIncludeDirective (configPath )
113+ err = EnsureIncludeDirective (t . Context (), configPath )
114114 assert .NoError (t , err )
115115
116116 content , err := os .ReadFile (configPath )
@@ -128,7 +128,7 @@ func TestEnsureIncludeDirective_PrependsToExisting(t *testing.T) {
128128}
129129
130130func TestGetHostConfigPath (t * testing.T ) {
131- path , err := GetHostConfigPath ("test-host" )
131+ path , err := GetHostConfigPath (t . Context (), "test-host" )
132132 assert .NoError (t , err )
133133 assert .Contains (t , path , filepath .Join (".databricks" , "ssh-tunnel-configs" , "test-host" ))
134134}
@@ -138,7 +138,7 @@ func TestHostConfigExists(t *testing.T) {
138138 t .Setenv ("HOME" , tmpDir )
139139 t .Setenv ("USERPROFILE" , tmpDir )
140140
141- exists , err := HostConfigExists ("nonexistent" )
141+ exists , err := HostConfigExists (t . Context (), "nonexistent" )
142142 assert .NoError (t , err )
143143 assert .False (t , exists )
144144
@@ -148,7 +148,7 @@ func TestHostConfigExists(t *testing.T) {
148148 err = os .WriteFile (filepath .Join (configDir , "existing-host" ), []byte ("config" ), 0o600 )
149149 require .NoError (t , err )
150150
151- exists , err = HostConfigExists ("existing-host" )
151+ exists , err = HostConfigExists (t . Context (), "existing-host" )
152152 assert .NoError (t , err )
153153 assert .True (t , exists )
154154}
@@ -164,7 +164,7 @@ func TestCreateOrUpdateHostConfig_NewConfig(t *testing.T) {
164164 assert .NoError (t , err )
165165 assert .True (t , created )
166166
167- configPath , err := GetHostConfigPath ("test-host" )
167+ configPath , err := GetHostConfigPath (ctx , "test-host" )
168168 require .NoError (t , err )
169169 content , err := os .ReadFile (configPath )
170170 assert .NoError (t , err )
@@ -189,7 +189,7 @@ func TestCreateOrUpdateHostConfig_ExistingConfigNoRecreate(t *testing.T) {
189189 assert .NoError (t , err )
190190 assert .False (t , created )
191191
192- configPath , err := GetHostConfigPath ("test-host" )
192+ configPath , err := GetHostConfigPath (ctx , "test-host" )
193193 require .NoError (t , err )
194194 content , err := os .ReadFile (configPath )
195195 assert .NoError (t , err )
@@ -214,7 +214,7 @@ func TestCreateOrUpdateHostConfig_ExistingConfigWithRecreate(t *testing.T) {
214214 assert .NoError (t , err )
215215 assert .True (t , created )
216216
217- configPath , err := GetHostConfigPath ("test-host" )
217+ configPath , err := GetHostConfigPath (ctx , "test-host" )
218218 require .NoError (t , err )
219219 content , err := os .ReadFile (configPath )
220220 assert .NoError (t , err )
0 commit comments