fix(test): only run lightwalletd test when the ZEBRA_TEST_LIGHTWALLETD env var is set (#3627)
* fix(test): only run lightwalletd test when the ZEBRA_TEST_LIGHTWALLETD env var is set * fix(test): actually skip the test
This commit is contained in:
parent
e75fe2c42f
commit
957a150254
|
@ -27,10 +27,7 @@ use color_eyre::{
|
||||||
};
|
};
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use std::{
|
use std::{collections::HashSet, convert::TryInto, env, path::Path, path::PathBuf, time::Duration};
|
||||||
collections::HashSet, convert::TryInto, env, net::SocketAddr, path::Path, path::PathBuf,
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
use zebra_chain::{
|
use zebra_chain::{
|
||||||
block::Height,
|
block::Height,
|
||||||
|
@ -1459,13 +1456,29 @@ async fn tracing_endpoint() -> Result<()> {
|
||||||
|
|
||||||
/// Launch `zebrad` with an RPC port, and make sure `lightwalletd` works with Zebra.
|
/// Launch `zebrad` with an RPC port, and make sure `lightwalletd` works with Zebra.
|
||||||
///
|
///
|
||||||
/// This test doesn't work on Windows, and it is ignored by default on other platforms.
|
/// This test only runs when the `ZEBRA_TEST_LIGHTWALLETD` env var is set.
|
||||||
|
///
|
||||||
|
/// This test doesn't work on Windows, so it is always skipped on that platform.
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
fn lightwalletd_integration() -> Result<()> {
|
fn lightwalletd_integration() -> Result<()> {
|
||||||
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
zebra_test::init();
|
zebra_test::init();
|
||||||
|
|
||||||
|
// Skip the test unless we specifically asked for it
|
||||||
|
//
|
||||||
|
// TODO: check if the lightwalletd binary is in the PATH?
|
||||||
|
// (this doesn't seem to be implemented in the standard library)
|
||||||
|
if env::var("ZEBRA_TEST_LIGHTWALLETD").is_err() {
|
||||||
|
tracing::info!(
|
||||||
|
"skipped lightwalletd integration test, \
|
||||||
|
set the 'ZEBRA_TEST_LIGHTWALLETD' environmental variable to run the test",
|
||||||
|
);
|
||||||
|
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
// Launch zebrad
|
// Launch zebrad
|
||||||
|
|
||||||
// [Note on port conflict](#Note on port conflict)
|
// [Note on port conflict](#Note on port conflict)
|
||||||
|
|
Loading…
Reference in New Issue