Skip to content

Commit

Permalink
consolidate test-gen justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Sep 17, 2023
1 parent e62066c commit a3bb50d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
18 changes: 18 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
download-integration-tests: clean-integration-tests
#!/usr/bin/env sh
TESTS_TAG=$(cat test-gen/spec-test-version)
REPO_NAME=consensus-spec-tests
CONFIGS="general minimal mainnet"
mkdir ${REPO_NAME}
for config in ${CONFIGS}
do
wget https://github.com/ethereum/${REPO_NAME}/releases/download/${TESTS_TAG}/${config}.tar.gz
tar -xzf ${config}.tar.gz -C ${REPO_NAME}
done
rm -f *tar.gz
clean-integration-tests:
rm -rf consensus-spec-tests
gen-tests:
cargo run -p test-gen --bin test-gen
just fmt
gen-spec:
cargo run -p spec-gen --bin spec-gen
just fmt
Expand Down
22 changes: 0 additions & 22 deletions test-gen/justfile

This file was deleted.

6 changes: 3 additions & 3 deletions test-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
use template::{build_index, TestIndex};
use walkdir::{DirEntry, Error, WalkDir};

const COMPONENTS_IN_TEST_ROOT: usize = 3;
const COMPONENTS_IN_TEST_ROOT: usize = 2;

fn component_to_string(c: Component) -> String {
let c = c.as_os_str().to_str().unwrap().to_string();
Expand Down Expand Up @@ -251,13 +251,13 @@ fn fix_clippy_lint(s: &mut String) {
fn main() {
let auxilliary_data = build_index();

let test_root = "../consensus-spec-tests/tests";
let test_root = "consensus-spec-tests/tests";
println!("discovering tests in {test_root}...");
let (all_test_cases, collected_test_case_count) = collect_test_cases(test_root).unwrap();

println!("collected {collected_test_case_count} tests");

let generated_test_root = PathBuf::from("../ethereum-consensus/tests/consensus_spec_tests");
let generated_test_root = PathBuf::from("ethereum-consensus/tests/consensus_spec_tests");
fs::remove_dir_all(&generated_test_root).unwrap();

fs::create_dir_all(&generated_test_root).unwrap();
Expand Down

0 comments on commit a3bb50d

Please sign in to comment.