Skip to content

Commit

Permalink
replace harcoded pattern for reproducible archives command for call t…
Browse files Browse the repository at this point in the history
…o filetools.reproducible_archive_cmd
  • Loading branch information
lexming committed Sep 30, 2024
1 parent ca09f4e commit d0a55ba
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions test/framework/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2939,16 +2939,11 @@ def run_check():
'git_repo': '[email protected]:easybuilders/testrepository.git',
'test_prefix': self.test_prefix,
}
reprod_tar_cmd_pattern = (
r' running shell command "find {} -name \".git\" -prune -o -print0 -exec touch -t 197001010100 {{}} \; |'
r' LC_ALL=C sort --zero-terminated | tar --create --no-recursion --owner=0 --group=0 --numeric-owner'
r' --format=gnu --null --files-from - | gzip --no-name > %(test_prefix)s/target/test.tar.gz'
)

expected = '\n'.join([
r' running shell command "git clone --depth 1 --branch tag_for_tests %(git_repo)s"',
r" \(in .*/tmp.*\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -2957,7 +2952,7 @@ def run_check():
expected = '\n'.join([
r' running shell command "git clone --depth 1 --branch tag_for_tests %(git_repo)s test123"',
r" \(in .*/tmp.*\)",
reprod_tar_cmd_pattern.format("test123"),
ft.reproducible_archive_cmd("test123", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -2967,7 +2962,7 @@ def run_check():
expected = '\n'.join([
r' running shell command "git clone --depth 1 --branch tag_for_tests --recursive %(git_repo)s"',
r" \(in .*/tmp.*\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -2977,7 +2972,7 @@ def run_check():
' running shell command "git clone --depth 1 --branch tag_for_tests --recursive'
+ ' --recurse-submodules=\'!vcflib\' --recurse-submodules=\'!sdsl-lite\' %(git_repo)s"',
r" \(in .*/tmp.*\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -2991,7 +2986,7 @@ def run_check():
+ ' clone --depth 1 --branch tag_for_tests --recursive'
+ ' --recurse-submodules=\'!vcflib\' --recurse-submodules=\'!sdsl-lite\' %(git_repo)s"',
r" \(in .*/tmp.*\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -3015,7 +3010,7 @@ def run_check():
r" \(in .*/tmp.*\)",
r' running shell command "git checkout 8456f86 && git submodule update --init --recursive"',
r" \(in testrepository\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -3026,7 +3021,7 @@ def run_check():
r" \(in .*/tmp.*\)",
r' running shell command "git checkout 8456f86"',
r" \(in testrepository\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in .*/tmp.*\)",
]) % string_args
run_check()
Expand All @@ -3038,7 +3033,7 @@ def run_check():
r" \(in /.*\)",
r' running shell command "git checkout 8456f86"',
r" \(in /.*/testrepository\)",
reprod_tar_cmd_pattern.format("testrepository"),
ft.reproducible_archive_cmd("testrepository", "%(test_prefix)s/target/test.tar.gz"),
r" \(in /.*\)",
]) % string_args
run_check()
Expand Down

0 comments on commit d0a55ba

Please sign in to comment.