add some stub tests

This commit is contained in:
Bryan Stitt 2023-06-29 12:41:21 -07:00
parent 294acbd712
commit ffc5a46dc4
4 changed files with 51 additions and 3 deletions

View File

@ -58,7 +58,8 @@ impl TestApp {
let anvil_provider = Provider::<Http>::try_from(anvil.endpoint()).unwrap();
// make a test TopConfig
// TODO: load TopConfig from a file? CliConfig could have `cli_config.load_top_config`. would need to inject our endpoint ports
// TODO: test influx
// TODO: test redis
let top_config = TopConfig {
app: AppConfig {
chain_id: 31337,
@ -76,7 +77,7 @@ impl TestApp {
..Default::default()
},
balanced_rpcs: HashMap::from([(
"anvil_both".to_string(),
"anvil".to_string(),
Web3RpcConfig {
http_url: Some(anvil.endpoint()),
ws_url: Some(anvil.ws_endpoint()),

View File

@ -0,0 +1,27 @@
mod common;
use crate::common::TestApp;
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_imitate_user() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_grant_credits() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_change_user_tier() {
let x = TestApp::spawn().await;
todo!();
}

View File

@ -7,7 +7,7 @@ use tokio::time::{sleep, Instant};
use web3_proxy::rpcs::blockchain::ArcBlock;
#[test_log::test(tokio::test)]
async fn it_works() {
async fn it_starts_and_stops() {
let x = TestApp::spawn().await;
let anvil_provider = &x.anvil_provider;
@ -65,5 +65,6 @@ async fn it_works() {
assert_eq!(anvil_result, proxy_result.unwrap());
// most tests won't need to wait, but we should wait here to be sure all the shutdown logic works properly
x.wait().await;
}

View File

@ -0,0 +1,19 @@
mod common;
use crate::common::TestApp;
#[ignore]
#[test_log::test(tokio::test)]
async fn test_log_in_and_out() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_referral_bonus() {
let x = TestApp::spawn().await;
todo!();
}