Skip to content

Commit

Permalink
Move impure download code to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Dec 3, 2020
1 parent a586bd6 commit 9983d37
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion validator_client/slashing_protection/Makefile
Expand Up @@ -10,7 +10,7 @@ $(OUTPUT_DIR): $(TARBALL)
tar --strip-components=1 -xzf $^ -C $@

$(TARBALL):
curl -L -o $@ $(ARCHIVE_URL)
curl --fail -L -o $@ $(ARCHIVE_URL)

clean-test-files:
rm -rf $(OUTPUT_DIR)
Expand Down
7 changes: 0 additions & 7 deletions validator_client/slashing_protection/build.rs

This file was deleted.

12 changes: 12 additions & 0 deletions validator_client/slashing_protection/tests/interop.rs
Expand Up @@ -2,7 +2,19 @@ use slashing_protection::interchange_test::MultiTestCase;
use std::fs::File;
use std::path::PathBuf;

fn download_tests() {
let make_output = std::process::Command::new("make")
.current_dir(std::env::var("CARGO_MANIFEST_DIR").unwrap())
.output()
.expect("need `make` to succeed to download and untar slashing protection tests");
if !make_output.status.success() {
eprintln!("{}", String::from_utf8_lossy(&make_output.stderr));
panic!("Running `make` for slashing protection tests failed, see above");
}
}

fn test_root_dir() -> PathBuf {
download_tests();
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("interchange-tests")
.join("tests")
Expand Down

0 comments on commit 9983d37

Please sign in to comment.