@@ -224,22 +224,21 @@ func (a *syncTest) snapshotContains(files []string) {
224224 _ , ok := s .LastModifiedTimes [filePath ]
225225 assert .True (a .t , ok , "%s not in snapshot file: %v" , filePath , s .LastModifiedTimes )
226226 }
227- assert .Equal (a .t , len (files ), len (s .LastModifiedTimes ))
227+ assert .Equal (a .t , len (files ), len (s .LastModifiedTimes ), "files=%s s.LastModifiedTimes=%s" , files , s . LastModifiedTimes )
228228}
229229
230230func TestSyncFullFileSync (t * testing.T ) {
231231 ctx , assertSync := setupSyncTest (t , "--full" , "--watch" )
232232
233- // .gitignore is created by the sync process to enforce .databricks is not synced
234233 assertSync .waitForCompletionMarker ()
235- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
234+ assertSync .remoteDirContent (ctx , "" , repoFiles )
236235
237236 // New file
238237 localFilePath := filepath .Join (assertSync .localRoot , "foo.txt" )
239238 f := testfile .CreateFile (t , localFilePath )
240239 defer f .Close (t )
241240 assertSync .waitForCompletionMarker ()
242- assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.txt" , ".gitignore" ))
241+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.txt" ))
243242 assertSync .remoteFileContent (ctx , "foo.txt" , "" )
244243
245244 // Write to file
@@ -255,24 +254,23 @@ func TestSyncFullFileSync(t *testing.T) {
255254 // delete
256255 f .Remove (t )
257256 assertSync .waitForCompletionMarker ()
258- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
257+ assertSync .remoteDirContent (ctx , "" , repoFiles )
259258}
260259
261260func TestSyncIncrementalFileSync (t * testing.T ) {
262261 ctx , assertSync := setupSyncTest (t , "--watch" )
263262
264- // .gitignore is created by the sync process to enforce .databricks is not synced
265263 assertSync .waitForCompletionMarker ()
266- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
264+ assertSync .remoteDirContent (ctx , "" , repoFiles )
267265
268266 // New file
269267 localFilePath := filepath .Join (assertSync .localRoot , "foo.txt" )
270268 f := testfile .CreateFile (t , localFilePath )
271269 defer f .Close (t )
272270 assertSync .waitForCompletionMarker ()
273- assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.txt" , ".gitignore" ))
271+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.txt" ))
274272 assertSync .remoteFileContent (ctx , "foo.txt" , "" )
275- assertSync .snapshotContains (append (repoFiles , "foo.txt" , ".gitignore" ))
273+ assertSync .snapshotContains (append (repoFiles , "foo.txt" ))
276274
277275 // Write to file
278276 f .Overwrite (t , `{"statement": "Mi Gente"}` )
@@ -287,16 +285,15 @@ func TestSyncIncrementalFileSync(t *testing.T) {
287285 // delete
288286 f .Remove (t )
289287 assertSync .waitForCompletionMarker ()
290- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
291- assertSync .snapshotContains (append ( repoFiles , ".gitignore" ) )
288+ assertSync .remoteDirContent (ctx , "" , repoFiles )
289+ assertSync .snapshotContains (repoFiles )
292290}
293291
294292func TestSyncNestedFolderSync (t * testing.T ) {
295293 ctx , assertSync := setupSyncTest (t , "--watch" )
296294
297- // .gitignore is created by the sync process to enforce .databricks is not synced
298295 assertSync .waitForCompletionMarker ()
299- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
296+ assertSync .remoteDirContent (ctx , "" , repoFiles )
300297
301298 // New file
302299 localFilePath := filepath .Join (assertSync .localRoot , "dir1/dir2/dir3/foo.txt" )
@@ -305,25 +302,24 @@ func TestSyncNestedFolderSync(t *testing.T) {
305302 f := testfile .CreateFile (t , localFilePath )
306303 defer f .Close (t )
307304 assertSync .waitForCompletionMarker ()
308- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " dir1" ))
305+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "dir1" ))
309306 assertSync .remoteDirContent (ctx , "dir1" , []string {"dir2" })
310307 assertSync .remoteDirContent (ctx , "dir1/dir2" , []string {"dir3" })
311308 assertSync .remoteDirContent (ctx , "dir1/dir2/dir3" , []string {"foo.txt" })
312- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " dir1/dir2/dir3/foo.txt" ))
309+ assertSync .snapshotContains (append (repoFiles , "dir1/dir2/dir3/foo.txt" ))
313310
314311 // delete
315312 f .Remove (t )
316313 assertSync .waitForCompletionMarker ()
317314 assertSync .remoteNotExist (ctx , "dir1" )
318- assertSync .snapshotContains (append ( repoFiles , ".gitignore" ) )
315+ assertSync .snapshotContains (repoFiles )
319316}
320317
321318func TestSyncNestedFolderDoesntFailOnNonEmptyDirectory (t * testing.T ) {
322319 ctx , assertSync := setupSyncTest (t , "--watch" )
323320
324- // .gitignore is created by the sync process to enforce .databricks is not synced
325321 assertSync .waitForCompletionMarker ()
326- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
322+ assertSync .remoteDirContent (ctx , "" , repoFiles )
327323
328324 // New file
329325 localFilePath := filepath .Join (assertSync .localRoot , "dir1/dir2/dir3/foo.txt" )
@@ -353,9 +349,8 @@ func TestSyncNestedFolderDoesntFailOnNonEmptyDirectory(t *testing.T) {
353349func TestSyncNestedSpacePlusAndHashAreEscapedSync (t * testing.T ) {
354350 ctx , assertSync := setupSyncTest (t , "--watch" )
355351
356- // .gitignore is created by the sync process to enforce .databricks is not synced
357352 assertSync .waitForCompletionMarker ()
358- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
353+ assertSync .remoteDirContent (ctx , "" , repoFiles )
359354
360355 // New file
361356 localFilePath := filepath .Join (assertSync .localRoot , "dir1/a b+c/c+d e/e+f g#i.txt" )
@@ -364,17 +359,17 @@ func TestSyncNestedSpacePlusAndHashAreEscapedSync(t *testing.T) {
364359 f := testfile .CreateFile (t , localFilePath )
365360 defer f .Close (t )
366361 assertSync .waitForCompletionMarker ()
367- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " dir1" ))
362+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "dir1" ))
368363 assertSync .remoteDirContent (ctx , "dir1" , []string {"a b+c" })
369364 assertSync .remoteDirContent (ctx , "dir1/a b+c" , []string {"c+d e" })
370365 assertSync .remoteDirContent (ctx , "dir1/a b+c/c+d e" , []string {"e+f g#i.txt" })
371- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " dir1/a b+c/c+d e/e+f g#i.txt" ))
366+ assertSync .snapshotContains (append (repoFiles , "dir1/a b+c/c+d e/e+f g#i.txt" ))
372367
373368 // delete
374369 f .Remove (t )
375370 assertSync .waitForCompletionMarker ()
376371 assertSync .remoteNotExist (ctx , "dir1/a b+c/c+d e" )
377- assertSync .snapshotContains (append ( repoFiles , ".gitignore" ) )
372+ assertSync .snapshotContains (repoFiles )
378373}
379374
380375// This is a check for the edge case when a user does the following:
@@ -395,23 +390,23 @@ func TestSyncIncrementalFileOverwritesFolder(t *testing.T) {
395390 f := testfile .CreateFile (t , localFilePath )
396391 defer f .Close (t )
397392 assertSync .waitForCompletionMarker ()
398- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo" ))
393+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo" ))
399394 assertSync .remoteDirContent (ctx , "foo" , []string {"bar.txt" })
400- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo/bar.txt" ))
395+ assertSync .snapshotContains (append (repoFiles , "foo/bar.txt" ))
401396
402397 // delete foo/bar.txt
403398 f .Remove (t )
404399 os .Remove (filepath .Join (assertSync .localRoot , "foo" ))
405400 assertSync .waitForCompletionMarker ()
406401 assertSync .remoteNotExist (ctx , "foo" )
407- assertSync .snapshotContains (append ( repoFiles , ".gitignore" ) )
402+ assertSync .snapshotContains (repoFiles )
408403
409404 f2 := testfile .CreateFile (t , filepath .Join (assertSync .localRoot , "foo" ))
410405 defer f2 .Close (t )
411406 assertSync .waitForCompletionMarker ()
412- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo" ))
407+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo" ))
413408 assertSync .objectType (ctx , "foo" , "FILE" )
414- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo" ))
409+ assertSync .snapshotContains (append (repoFiles , "foo" ))
415410}
416411
417412func TestSyncIncrementalSyncPythonNotebookToFile (t * testing.T ) {
@@ -425,23 +420,23 @@ func TestSyncIncrementalSyncPythonNotebookToFile(t *testing.T) {
425420
426421 // notebook was uploaded properly
427422 assertSync .waitForCompletionMarker ()
428- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo" ))
423+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo" ))
429424 assertSync .objectType (ctx , "foo" , "NOTEBOOK" )
430425 assertSync .language (ctx , "foo" , "PYTHON" )
431- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo.py" ))
426+ assertSync .snapshotContains (append (repoFiles , "foo.py" ))
432427
433428 // convert to vanilla python file
434429 f .Overwrite (t , "# No longer a python notebook" )
435430 assertSync .waitForCompletionMarker ()
436431 assertSync .objectType (ctx , "foo.py" , "FILE" )
437- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo.py" ))
438- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo.py" ))
432+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.py" ))
433+ assertSync .snapshotContains (append (repoFiles , "foo.py" ))
439434
440435 // delete the vanilla python file
441436 f .Remove (t )
442437 assertSync .waitForCompletionMarker ()
443- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
444- assertSync .snapshotContains (append ( repoFiles , ".gitignore" ) )
438+ assertSync .remoteDirContent (ctx , "" , repoFiles )
439+ assertSync .snapshotContains (repoFiles )
445440}
446441
447442func TestSyncIncrementalSyncFileToPythonNotebook (t * testing.T ) {
@@ -454,17 +449,17 @@ func TestSyncIncrementalSyncFileToPythonNotebook(t *testing.T) {
454449 assertSync .waitForCompletionMarker ()
455450
456451 // assert file upload
457- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo.py" ))
452+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo.py" ))
458453 assertSync .objectType (ctx , "foo.py" , "FILE" )
459- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo.py" ))
454+ assertSync .snapshotContains (append (repoFiles , "foo.py" ))
460455
461456 // convert to notebook
462457 f .Overwrite (t , "# Databricks notebook source" )
463458 assertSync .waitForCompletionMarker ()
464459 assertSync .objectType (ctx , "foo" , "NOTEBOOK" )
465460 assertSync .language (ctx , "foo" , "PYTHON" )
466- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo" ))
467- assertSync .snapshotContains (append (repoFiles , ".gitignore" , " foo.py" ))
461+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo" ))
462+ assertSync .snapshotContains (append (repoFiles , "foo.py" ))
468463}
469464
470465func TestSyncIncrementalSyncPythonNotebookDelete (t * testing.T ) {
@@ -478,14 +473,14 @@ func TestSyncIncrementalSyncPythonNotebookDelete(t *testing.T) {
478473 assertSync .waitForCompletionMarker ()
479474
480475 // notebook was uploaded properly
481- assertSync .remoteDirContent (ctx , "" , append (repoFiles , ".gitignore" , " foo" ))
476+ assertSync .remoteDirContent (ctx , "" , append (repoFiles , "foo" ))
482477 assertSync .objectType (ctx , "foo" , "NOTEBOOK" )
483478 assertSync .language (ctx , "foo" , "PYTHON" )
484479
485480 // Delete notebook
486481 f .Remove (t )
487482 assertSync .waitForCompletionMarker ()
488- assertSync .remoteDirContent (ctx , "" , append ( repoFiles , ".gitignore" ) )
483+ assertSync .remoteDirContent (ctx , "" , repoFiles )
489484}
490485
491486func TestSyncEnsureRemotePathIsUsableIfRepoDoesntExist (t * testing.T ) {
0 commit comments