Skip to content

Commit

Permalink
Add test for symlinks.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Feb 19, 2024
1 parent f3b6e08 commit fcd4b90
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
import shutil

from integration_tests.config import PARENT_OUTPUT_FOLDER
from integration_tests.shared import download_project_repository, run_docker


def test_with_symlinks():
workspace_parent = download_project_repository("https://github.com/multiversx/mx-contracts-rs/archive/refs/tags/v0.45.2.2.zip", "test_with_symlinks")
workspace = workspace_parent / "mx-contracts-rs-0.45.2.2"

output_folder = PARENT_OUTPUT_FOLDER / "test_with_symlinks"
shutil.rmtree(output_folder, ignore_errors=True)
output_folder.mkdir(parents=True, exist_ok=True)

# In the workspace, create a symlink towards something outside it:
dummy_file = workspace_parent / "dummy"
dummy_file.touch()
os.symlink(dummy_file, workspace / "dummy")

# Symlinks should be ignored, and the build should succeed.
run_docker(
project_path=workspace,
packaged_src_path=None,
contract_name="adder",
image="sdk-rust-contract-builder:next",
output_folder=output_folder
)

assert (output_folder / "artifacts.json").exists()
1 change: 1 addition & 0 deletions integration_tests/test_previous_builds_are_reproducible.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def main(cli_args: List[str]):
contract_name=build.contract_name,
image=build.docker_image,
output_folder=output_folder)

check_code_hashes(build, output_folder)


Expand Down

0 comments on commit fcd4b90

Please sign in to comment.