diff --git a/tests_integration/nativeapp/test_deploy.py b/tests_integration/nativeapp/test_deploy.py index 52ab389b8..e85d57457 100644 --- a/tests_integration/nativeapp/test_deploy.py +++ b/tests_integration/nativeapp/test_deploy.py @@ -500,7 +500,7 @@ def test_nativeapp_deploy_looks_for_prefix_matches( ) project_definition_file["native_app"]["artifacts"].append("src") project_definition_file["native_app"]["artifacts"].append( - "lib/parent/child" + {"src": "lib/parent", "dest": "parent-lib"} ) snowflake_yml.write_text(yaml.dump(project_definition_file)) @@ -510,7 +510,7 @@ def test_nativeapp_deploy_looks_for_prefix_matches( touch(str(project_dir / "lib/parent/child/b.py")) touch(str(project_dir / "lib/parent/child/c/c.py")) - result = runner.invoke_with_connection_json( + result = runner.invoke_with_connection( ["app", "deploy", "-r", "app"], env=TEST_ENV, ) @@ -527,55 +527,72 @@ def test_nativeapp_deploy_looks_for_prefix_matches( stage_files.json, {"name": "stage/setup_script.sql"} ) assert contains_row_with(stage_files.json, {"name": "stage/README.md"}) - assert not_contains_row_with(stage_files.json, {"name": "src/main.py"}) + assert not_contains_row_with( + stage_files.json, {"name": "stage/src/main.py"} + ) + assert not_contains_row_with( + stage_files.json, {"name": "stage/parent-lib/child/c/c.py"} + ) - result = runner.invoke_with_connection_json( + result = runner.invoke_with_connection( ["app", "deploy", "-r", "lib/parent/child/c"], env=TEST_ENV, ) assert result.exit_code == 0 + stage_files = runner.invoke_with_connection_json( + ["stage", "list-files", f"{package_name}.{stage_name}"], + env=TEST_ENV, + ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/c/c.py"} + stage_files.json, {"name": "stage/parent-lib/child/c/c.py"} ) assert not_contains_row_with( - stage_files.json, {"name": "lib/parent/child/a.py"} + stage_files.json, {"name": "stage/parent-lib/child/a.py"} ) assert not_contains_row_with( - stage_files.json, {"name": "lib/parent/child/b.py"} + stage_files.json, {"name": "stage/parent-lib/child/b.py"} ) - result = runner.invoke_with_connection_json( + result = runner.invoke_with_connection( ["app", "deploy", "lib/parent/child/a.py"], env=TEST_ENV, ) assert result.exit_code == 0 + stage_files = runner.invoke_with_connection_json( + ["stage", "list-files", f"{package_name}.{stage_name}"], + env=TEST_ENV, + ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/c/c.py"} + stage_files.json, {"name": "stage/parent-lib/child/c/c.py"} ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/a.py"} + stage_files.json, {"name": "stage/parent-lib/child/a.py"} ) assert not_contains_row_with( - stage_files.json, {"name": "lib/parent/child/b.py"} + stage_files.json, {"name": "stage/parent-lib/child/b.py"} ) - result = runner.invoke_with_connection_json( + result = runner.invoke_with_connection( ["app", "deploy", "lib", "-r"], env=TEST_ENV, ) assert result.exit_code == 0 + stage_files = runner.invoke_with_connection_json( + ["stage", "list-files", f"{package_name}.{stage_name}"], + env=TEST_ENV, + ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/c/c.py"} + stage_files.json, {"name": "stage/parent-lib/child/c/c.py"} ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/a.py"} + stage_files.json, {"name": "stage/parent-lib/child/a.py"} ) assert contains_row_with( - stage_files.json, {"name": "lib/parent/child/b.py"} + stage_files.json, {"name": "stage/parent-lib/child/b.py"} ) finally: - result = runner.invoke_with_connection_json( + result = runner.invoke_with_connection( ["app", "teardown", "--force"], env=TEST_ENV, )