Skip to content

Commit

Permalink
[NADE] Introduce order for iterating over files in bundle, fix tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bgoel authored and sfc-gh-turbaszek committed Jun 18, 2024
1 parent 2627753 commit 635a080
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 46 deletions.
2 changes: 1 addition & 1 deletion src/snowflake/cli/plugins/nativeapp/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def symlink_or_copy(src: Path, dst: Path, deploy_root: Path) -> None:
relative_root = Path(root).relative_to(absolute_src)
absolute_root_in_deploy = Path(dst, relative_root)
absolute_root_in_deploy.mkdir(parents=True, exist_ok=True)
for file in files:
for file in sorted(files):
absolute_file_in_project = Path(absolute_src, relative_root, file)
absolute_file_in_deploy = Path(absolute_root_in_deploy, file)
symlink_or_copy(
Expand Down
36 changes: 0 additions & 36 deletions tests/nativeapp/__snapshots__/test_artifacts.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -226,42 +226,6 @@
Text GrandA/ParentA/ChildA/GrandChildB.py
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.20
'''
d output/deploy/Grand4/Parent3
d output/deploy/Grand4/Parent3/ChildA
f output/deploy/Grand4/Parent3/ChildA/GrandChildA
f output/deploy/Grand4/Parent3/ChildA/GrandChildB.py
d output/deploy/Grand4/Parent3/ChildA/GrandChildC
f output/deploy/Grand4/Parent3/ChildB.py
f output/deploy/Grand4/Parent3/ChildC
d output/deploy/Grand4/Parent3/ChildD
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.21
'''
===== Contents of: output/deploy/Grand4/Parent3/ChildA/GrandChildA =====
Text GrandA/ParentA/ChildA/GrandChildA
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.22
'''
===== Contents of: output/deploy/Grand4/Parent3/ChildA/GrandChildB.py =====
Text GrandA/ParentA/ChildA/GrandChildB.py
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.23
'''
===== Contents of: output/deploy/Grand4/Parent3/ChildB.py =====
Text GrandA/ParentA/ChildB.py
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.24
'''
===== Contents of: output/deploy/Grand4/Parent3/ChildC =====
Text GrandA/ParentA/ChildC
'''
# ---
# name: test_symlink_or_copy_with_no_symlinks_in_project_root.3
'''
===== Contents of: GrandA/ParentA/ChildB.py =====
Expand Down
9 changes: 0 additions & 9 deletions tests/nativeapp/test_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,15 +1118,6 @@ def test_symlink_or_copy_with_no_symlinks_in_project_root(snapshot):
dst=Path(deploy_root, "Grand4/Parent3"),
deploy_root=deploy_root,
)
assert not Path(deploy_root, "Grand4/Parent3").is_symlink()
assert not Path(deploy_root, "Grand4/Parent3/ChildA").is_symlink()
assert Path(deploy_root, "Grand4/Parent3/ChildB.py").is_symlink()
assert Path(deploy_root, "Grand4/Parent3/ChildC").is_symlink()
assert not Path(
deploy_root, "Grand4/Parent3/ChildC/GrandChildA"
).is_symlink()

assert_dir_snapshot(Path("./output/deploy/Grand4/Parent3"), snapshot)


def test_symlink_or_copy_with_symlinks_in_project_root(snapshot):
Expand Down

0 comments on commit 635a080

Please sign in to comment.