From f848f79f203ef7edf3ced900885744a7d25ac424 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Fri, 19 Jul 2024 14:17:27 -0500 Subject: [PATCH] Remove test_deterministic_build It's a huge pain to maintain, and it doesn't seem to work well in Github Actions --- c/test_euler.py | 22 ---------------------- cplusplus/test_euler.py | 20 -------------------- 2 files changed, 42 deletions(-) diff --git a/c/test_euler.py b/c/test_euler.py index 397c94a2..94832ff2 100644 --- a/c/test_euler.py +++ b/c/test_euler.py @@ -219,28 +219,6 @@ def test_compiler_macros(compiler): assert flags[9] == (EXE_EXT not in ("x86", "x86_64", "exe")) -@mark.skipif('NO_OPTIONAL_TESTS') -def test_deterministic_build(c_file, compiler): - exename1 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler) - exename2 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler) - environ['SOURCE_DATE_EPOCH'] = '1' - environ['ZERO_AR_DATE'] = 'true' - check_call(templates[compiler].format(c_file, exename1).split()) - sleep(2) - check_call(templates[compiler].format(c_file, exename2).split()) - try: - with open(exename1, "rb") as f, open(exename2, "rb") as g: - assert f.read() == g.read() - except AssertionError: - if IN_WINDOWS and compiler != 'CL': # mingw gcc doesn't seem to make reproducible builds - xfail() - elif compiler == 'PCC': - xfail() # PCC doesn't allow reproducible builds with static keyword - elif compiler == 'GCC' and environ.get('COV') == 'true': - xfail() # GCC doesn't do reproducible builds w/ code coverage - raise - - @mark.skipif('NO_OPTIONAL_TESTS or ONLY_SLOW') def test_is_prime(benchmark, compiler): from p0007 import is_prime, prime_factors, primes diff --git a/cplusplus/test_euler.py b/cplusplus/test_euler.py index 1e6d3224..c7e82270 100644 --- a/cplusplus/test_euler.py +++ b/cplusplus/test_euler.py @@ -192,26 +192,6 @@ def test_compiler_macros(compiler): assert flags[7] == (EXE_EXT not in ("x86", "x86_64", "exe")) -@mark.skipif('NO_OPTIONAL_TESTS') -def test_deterministic_build(c_file, compiler): - exename1 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler) - exename2 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler) - environ['SOURCE_DATE_EPOCH'] = '1' - environ['ZERO_AR_DATE'] = 'true' - check_call(templates[compiler].format(c_file, exename1).split()) - sleep(2) - check_call(templates[compiler].format(c_file, exename2).split()) - try: - with open(exename1, "rb") as f, open(exename2, "rb") as g: - assert f.read() == g.read() - except AssertionError: - if IN_WINDOWS and compiler != 'CL': # mingw gcc doesn't seem to make reproducible builds - xfail() - elif compiler == 'GCC' and environ.get('COV') == 'true': - xfail() # GCC doesn't do reproducible builds w/ code coverage - raise - - # @mark.skipif('NO_OPTIONAL_TESTS or ONLY_SLOW') # def test_is_prime(benchmark, compiler): # from p0007 import is_prime, prime_factors, primes