Simultaenously build Docker images used in tests

This commit is contained in:
Luke Parker
2023-11-27 01:10:23 -05:00
parent 571195bfda
commit 292263b21e
23 changed files with 639 additions and 526 deletions

View File

@@ -19,8 +19,8 @@ mod bitcoin {
check::<IsTrue<{ Bitcoin::DUST >= bitcoin_serai::wallet::DUST }>>();
}
fn spawn_bitcoin() -> DockerTest {
serai_docker_tests::build("bitcoin".to_string());
async fn spawn_bitcoin() -> DockerTest {
serai_docker_tests::build("bitcoin".to_string()).await;
let composition = TestBodySpecification::with_image(
Image::with_repository("serai-dev-bitcoin").pull_policy(PullPolicy::Never),
@@ -73,8 +73,8 @@ mod monero {
use super::*;
use crate::networks::{Network, Monero};
fn spawn_monero() -> DockerTest {
serai_docker_tests::build("monero".to_string());
async fn spawn_monero() -> DockerTest {
serai_docker_tests::build("monero".to_string()).await;
let composition = TestBodySpecification::with_image(
Image::with_repository("serai-dev-monero").pull_policy(PullPolicy::Never),

View File

@@ -44,49 +44,59 @@ macro_rules! test_network {
test_key_gen::<$N>().await;
}
#[test]
fn $scanner() {
#[tokio::test]
async fn $scanner() {
*INIT_LOGGER;
let docker = $docker();
docker.run(|ops| async move {
test_scanner($network(&ops).await).await;
});
let docker = $docker().await;
docker
.run_async(|ops| async move {
test_scanner($network(&ops).await).await;
})
.await;
}
#[test]
fn $signer() {
#[tokio::test]
async fn $signer() {
*INIT_LOGGER;
let docker = $docker();
docker.run(|ops| async move {
test_signer($network(&ops).await).await;
});
let docker = $docker().await;
docker
.run_async(|ops| async move {
test_signer($network(&ops).await).await;
})
.await;
}
#[test]
fn $wallet() {
#[tokio::test]
async fn $wallet() {
*INIT_LOGGER;
let docker = $docker();
docker.run(|ops| async move {
test_wallet($network(&ops).await).await;
});
let docker = $docker().await;
docker
.run_async(|ops| async move {
test_wallet($network(&ops).await).await;
})
.await;
}
#[test]
fn $addresses() {
#[tokio::test]
async fn $addresses() {
*INIT_LOGGER;
let docker = $docker();
docker.run(|ops| async move {
test_addresses($network(&ops).await).await;
});
let docker = $docker().await;
docker
.run_async(|ops| async move {
test_addresses($network(&ops).await).await;
})
.await;
}
#[test]
fn $no_deadlock_in_multisig_completed() {
#[tokio::test]
async fn $no_deadlock_in_multisig_completed() {
*INIT_LOGGER;
let docker = $docker();
docker.run(|ops| async move {
test_no_deadlock_in_multisig_completed($network(&ops).await).await;
});
let docker = $docker().await;
docker
.run_async(|ops| async move {
test_no_deadlock_in_multisig_completed($network(&ops).await).await;
})
.await;
}
};
}