From 43ecf87cb3c64b0412cad598940452269b827503 Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 19 Dec 2023 11:09:58 +0100 Subject: [PATCH] drop CI dependency on clvm_tools_rs. It's only used by run-programs.py to compile .clvm -> .hex. But the hex files are already checked in. --- .github/workflows/benchmark.yml | 5 ----- benches/run-program.rs | 13 ++++++------- tests/run-programs.py | 13 ++++++++++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5dbc500b..776bdee6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,11 +71,6 @@ jobs: python -m pip install maturin rustup target add x86_64-unknown-linux-musl - # we need this for brun and opc - - name: install clvm_tools - run: | - cargo install clvm_tools_rs - - name: Build env: CC: gcc diff --git a/benches/run-program.rs b/benches/run-program.rs index ef1cb729..94b9da97 100644 --- a/benches/run-program.rs +++ b/benches/run-program.rs @@ -224,14 +224,13 @@ fn run_program_benchmark(c: &mut Criterion) { ] { a.restore_checkpoint(&test_case_checkpoint); - println!("benchmark/{test}.hex"); - let prg = read_to_string(format!("benchmark/{test}.hex")) - .expect("failed to load benchmark program"); - let prg = hex::decode(prg.trim()).expect("invalid hex in benchmark program"); - let prg = node_from_bytes(&mut a, &prg[..]).expect("failed to parse benchmark program"); - let env = make_env(&mut a); - let iter_checkpoint = a.checkpoint(); group.bench_function(*test, |b| { + let prg = read_to_string(format!("benchmark/{test}.hex")) + .expect("failed to load benchmark program"); + let prg = hex::decode(prg.trim()).expect("invalid hex in benchmark program"); + let prg = node_from_bytes(&mut a, &prg[..]).expect("failed to parse benchmark program"); + let env = make_env(&mut a); + let iter_checkpoint = a.checkpoint(); b.iter(|| { a.restore_checkpoint(&iter_checkpoint); let start = Instant::now(); diff --git a/tests/run-programs.py b/tests/run-programs.py index dd85b3fc..f051f516 100755 --- a/tests/run-programs.py +++ b/tests/run-programs.py @@ -7,6 +7,7 @@ import platform from colorama import init, Fore, Style from run import run_clvm +from os.path import isfile init() ret = 0 @@ -14,23 +15,30 @@ for fn in glob.glob('programs/large-atom-*.hex.invalid'): try: + print(fn) run_clvm(fn) ret = 1 - print("FAILED: expected parse failure") + print(Fore.RED + "FAILED: expected parse failure" + Style.RESET_ALL) except Exception as e: - print("expected failure: %s" % e) + print(Fore.GREEN + f"OK: expected: {e}" + Style.RESET_ALL) for fn in glob.glob('programs/*.clvm'): hexname = fn[:-4] + 'hex' + if isfile(hexname): + continue with open(hexname, 'w+') as out: + print(f"compiling {fn}") proc = subprocess.Popen(['opc', fn], stdout=out) proc.wait() for fn in glob.glob('programs/*.env'): hexenv = fn + 'hex' + if isfile(hexenv): + continue with open(hexenv, 'w+') as out: + print(f"compiling {fn}") proc = subprocess.Popen(['opc', fn], stdout=out) proc.wait() @@ -38,7 +46,6 @@ hexenv = hexname[:-3] + 'envhex' -# command = ['brun', '-m', '11000000000', '-c', '--backend=rust', '--quiet', '--time', '--hex', hexname, hexenv] command = ['./run.py', hexname, hexenv] # prepend the size command, to measure RSS