Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = true
37 changes: 37 additions & 0 deletions acceptance/cmd/sync-incremental/file-replaces-folder/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

=== Create foo/bar.txt

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo
Uploaded foo/bar.txt

>>> remote_tree
DIRECTORY foo
FILE foo/bar.txt

>>> snapshot_files
foo/bar.txt

=== Delete foo/bar.txt and the foo folder

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted foo
Deleted foo/bar.txt
Initial Sync Complete

>>> remote_tree

>>> snapshot_files

=== Create a file named foo where the folder used to be

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo

>>> remote_tree
FILE foo

>>> snapshot_files
foo
18 changes: 18 additions & 0 deletions acceptance/cmd/sync-incremental/file-replaces-folder/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title "Create foo/bar.txt\n"
mkdir src/foo
touch src/foo/bar.txt
sync_once
trace remote_tree
trace snapshot_files

title "Delete foo/bar.txt and the foo folder\n"
rm -r src/foo
sync_once
trace remote_tree
trace snapshot_files

title "Create a file named foo where the folder used to be\n"
touch src/foo
sync_once
trace remote_tree
trace snapshot_files
1 change: 1 addition & 0 deletions acceptance/cmd/sync-incremental/files/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = true
63 changes: 63 additions & 0 deletions acceptance/cmd/sync-incremental/files/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

=== Initial sync of an empty directory

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete

>>> remote_tree

=== New file

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo.txt

>>> remote_tree
FILE foo.txt

>>> remote_content foo.txt

>>> snapshot_files
foo.txt

=== Write to file

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo.txt

>>> remote_content foo.txt
{"statement": "Mi Gente"}

=== Write again

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo.txt

>>> remote_content foo.txt
{"statement": "Young Dumb & Broke"}

=== Sync without changes uploads nothing

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete

=== Full sync uploads unchanged files again

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME] --full
Initial Sync Complete
Uploaded foo.txt

>>> remote_content foo.txt
{"statement": "Young Dumb & Broke"}

=== Delete

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted foo.txt
Initial Sync Complete

>>> remote_tree

>>> snapshot_files
33 changes: 33 additions & 0 deletions acceptance/cmd/sync-incremental/files/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
title "Initial sync of an empty directory\n"
sync_once
trace remote_tree

title "New file\n"
touch src/foo.txt
sync_once
trace remote_tree
trace remote_content foo.txt
trace snapshot_files

title "Write to file\n"
echo '{"statement": "Mi Gente"}' > src/foo.txt
sync_once
trace remote_content foo.txt

title "Write again\n"
echo '{"statement": "Young Dumb & Broke"}' > src/foo.txt
sync_once
trace remote_content foo.txt

title "Sync without changes uploads nothing\n"
sync_once

title "Full sync uploads unchanged files again\n"
sync_once --full
trace remote_content foo.txt

title "Delete\n"
rm src/foo.txt
sync_once
trace remote_tree
trace snapshot_files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = true
58 changes: 58 additions & 0 deletions acceptance/cmd/sync-incremental/nested-folders/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

=== New file in nested folders

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded dir1/dir2/dir3
Uploaded dir1/dir2/dir3/foo.txt

>>> remote_tree
DIRECTORY dir1
DIRECTORY dir1/dir2
DIRECTORY dir1/dir2/dir3
FILE dir1/dir2/dir3/foo.txt

>>> snapshot_files
dir1/dir2/dir3/foo.txt

=== Delete the file; the empty remote folders are removed too

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted dir1
Deleted dir1/dir2
Deleted dir1/dir2/dir3
Deleted dir1/dir2/dir3/foo.txt
Initial Sync Complete

>>> remote_tree

>>> snapshot_files

=== Spaces, plus and hash in folder and file names

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded dir1/a b+c/c+d e
Uploaded dir1/a b+c/c+d e/e+f g#i.txt

>>> remote_tree
DIRECTORY dir1
DIRECTORY dir1/a b+c
DIRECTORY dir1/a b+c/c+d e
FILE dir1/a b+c/c+d e/e+f g#i.txt

>>> snapshot_files
dir1/a b+c/c+d e/e+f g#i.txt

=== Delete the file with special characters

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted dir1
Deleted dir1/a b+c
Deleted dir1/a b+c/c+d e
Deleted dir1/a b+c/c+d e/e+f g#i.txt
Initial Sync Complete

>>> remote_tree

>>> snapshot_files
25 changes: 25 additions & 0 deletions acceptance/cmd/sync-incremental/nested-folders/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title "New file in nested folders\n"
mkdir -p src/dir1/dir2/dir3
touch src/dir1/dir2/dir3/foo.txt
sync_once
trace remote_tree
trace snapshot_files

title "Delete the file; the empty remote folders are removed too\n"
rm src/dir1/dir2/dir3/foo.txt
sync_once
trace remote_tree
trace snapshot_files

title "Spaces, plus and hash in folder and file names\n"
mkdir -p "src/dir1/a b+c/c+d e"
touch "src/dir1/a b+c/c+d e/e+f g#i.txt"
sync_once
trace remote_tree
trace snapshot_files

title "Delete the file with special characters\n"
rm "src/dir1/a b+c/c+d e/e+f g#i.txt"
sync_once
trace remote_tree
trace snapshot_files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = true
30 changes: 30 additions & 0 deletions acceptance/cmd/sync-incremental/nonempty-remote-dir/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

=== New file in nested folders

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded dir1/dir2/dir3
Uploaded dir1/dir2/dir3/foo.txt

>>> remote_tree
DIRECTORY dir1
DIRECTORY dir1/dir2
DIRECTORY dir1/dir2/dir3
FILE dir1/dir2/dir3/foo.txt

=== Write a file to dir1 directly in the workspace

>>> [CLI] workspace import /Users/[USERNAME]/sync-[UNIQUE_NAME]/dir1/foo.txt --format RAW --content Y29udGVudHM=

=== Delete the local file: sync removes dir2 and dir3 but keeps dir1, which is not empty

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted dir1
Deleted dir1/dir2
Deleted dir1/dir2/dir3
Deleted dir1/dir2/dir3/foo.txt
Initial Sync Complete

>>> remote_tree
DIRECTORY dir1
FILE dir1/foo.txt
13 changes: 13 additions & 0 deletions acceptance/cmd/sync-incremental/nonempty-remote-dir/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title "New file in nested folders\n"
mkdir -p src/dir1/dir2/dir3
touch src/dir1/dir2/dir3/foo.txt
sync_once
trace remote_tree

title "Write a file to dir1 directly in the workspace\n"
trace $CLI workspace import "$remote_dir/dir1/foo.txt" --format RAW --content "$(printf contents | base64)"

title "Delete the local file: sync removes dir2 and dir3 but keeps dir1, which is not empty\n"
rm src/dir1/dir2/dir3/foo.txt
sync_once
trace remote_tree
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = true
67 changes: 67 additions & 0 deletions acceptance/cmd/sync-incremental/notebook-transitions/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

=== Python notebook is uploaded without its extension

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded foo.py

>>> remote_tree
NOTEBOOK foo PYTHON

>>> snapshot_files
foo.py

=== Turn the notebook into a plain Python file

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted foo
Initial Sync Complete
Uploaded foo.py

>>> remote_tree
FILE foo.py

>>> snapshot_files
foo.py

=== Delete the plain Python file

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted foo.py
Initial Sync Complete

>>> remote_tree

>>> snapshot_files

=== Plain Python file

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Initial Sync Complete
Uploaded bar.py

>>> remote_tree
FILE bar.py

=== Turn the plain Python file into a notebook

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted bar.py
Initial Sync Complete
Uploaded bar.py

>>> remote_tree
NOTEBOOK bar PYTHON

>>> snapshot_files
bar.py

=== Delete the notebook

>>> [CLI] sync src /Users/[USERNAME]/sync-[UNIQUE_NAME]
Deleted bar
Initial Sync Complete

>>> remote_tree

>>> snapshot_files
34 changes: 34 additions & 0 deletions acceptance/cmd/sync-incremental/notebook-transitions/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title "Python notebook is uploaded without its extension\n"
echo "# Databricks notebook source" > src/foo.py
sync_once
trace remote_tree
trace snapshot_files

title "Turn the notebook into a plain Python file\n"
echo "# No longer a python notebook" > src/foo.py
sync_once
trace remote_tree
trace snapshot_files

title "Delete the plain Python file\n"
rm src/foo.py
sync_once
trace remote_tree
trace snapshot_files

title "Plain Python file\n"
touch src/bar.py
sync_once
trace remote_tree

title "Turn the plain Python file into a notebook\n"
echo "# Databricks notebook source" > src/bar.py
sync_once
trace remote_tree
trace snapshot_files

title "Delete the notebook\n"
rm src/bar.py
sync_once
trace remote_tree
trace snapshot_files
Loading
Loading