Skip to content

Commit

Permalink
Windows Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturWieczorek committed Jun 5, 2023
1 parent 905c4a6 commit 6d2c720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/node_sync_test.yaml
Expand Up @@ -187,8 +187,7 @@ jobs:
env:
BLOCKFROST_API_KEY: ${{ secrets.BLOCKFROST_API_KEY }}
run: |
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
git checkout artur/sync_tests_update
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
cd cardano_node_tests
echo "current branch: $(git branch --show-current)"
python sync_tests/node_sync_test.py -e ${{ matrix.env }} -b ${{ github.event.inputs.build_mode }} -t1 "${{ github.event.inputs.tag_no1 }}" -t2 "${{ github.event.inputs.tag_no2 }}" -r1 "${{ github.event.inputs.node_rev1 }}" -r2 "${{ github.event.inputs.node_rev2 }}" -n1 "${{ github.event.inputs.node_topology1 }}" -n2 "${{ github.event.inputs.node_topology2 }}" -a1="${{ github.event.inputs.node_start_arguments1 }}" -a2="${{ github.event.inputs.node_start_arguments2 }}"
Expand Down
11 changes: 5 additions & 6 deletions sync_tests/node_sync_test.py
Expand Up @@ -48,7 +48,7 @@ def execute_command(command):
try:
cmd = shlex.split(command)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
outs, errors = process.communicate(timeout=3600)
outs, errors = process.communicate(timeout=7200)
if errors:
print_warn(f"Warnings or Errors: {errors}")
if outs:
Expand Down Expand Up @@ -721,12 +721,13 @@ def copy_node_executables(src_location, dst_location, build_mode):
def get_node_files(node_rev, repository=None, build_tool='nix'):
test_directory = Path.cwd()
repo = None
print(f"test_directory: {test_directory}")
print_info(f"test_directory: {test_directory}")
print(f" - listdir test_directory: {os.listdir(test_directory)}")

repo_name = 'cardano-node'
repo_dir = test_directory / 'cardano_node_dir'

if repo_dir.is_dir():
if is_dir(repo_dir):
repo = git_checkout(repository, node_rev)
else:
repo = git_clone_iohk_repo(repo_name, repo_dir, node_rev)
Expand All @@ -739,9 +740,7 @@ def get_node_files(node_rev, repository=None, build_tool='nix'):
execute_command("nix build -v .#cardano-cli -o cardano-cli-bin")
copy_node_executables(repo_dir, test_directory, "nix")
elif build_tool == 'cabal':
os.chdir(Path(ROOT_TEST_PATH))
repo = git_checkout(repository, node_rev) if repo_dir.is_dir() else git_clone_iohk_repo(repo_name, repo_dir, node_rev)
cabal_local_file = Path(ROOT_TEST_PATH) / 'sync_tests' / 'cabal.project.local'
cabal_local_file = Path(test_directory) / 'sync_tests' / 'cabal.project.local'
shutil.copy2(cabal_local_file, repo_dir)
os.chdir(repo_dir)
for line in fileinput.input("cabal.project", inplace=True):
Expand Down

0 comments on commit 6d2c720

Please sign in to comment.