Only run http_api tests in release (#1827)

## Issue Addressed

NA

## Proposed Changes

As raised by @hermanjunge in a DM, the `http_api` tests have been observed taking 100+ minutes on debug. This PR:

- Moves the `http_api` tests to only run in release.
- Groups some `http_api` tests to reduce test-setup overhead.

## Additional Info

NA
This commit is contained in:
Paul Hauner 2020-10-29 22:25:20 +00:00
parent ae0f025375
commit f64f8246db

View File

@ -1,3 +1,5 @@
#![cfg(not(debug_assertions))] // Tests are too slow in debug.
use beacon_chain::{ use beacon_chain::{
test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType}, test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType},
BeaconChain, StateSkipConfig, BeaconChain, StateSkipConfig,
@ -1660,61 +1662,44 @@ impl ApiTester {
} }
#[tokio::test(core_threads = 2)] #[tokio::test(core_threads = 2)]
async fn beacon_genesis() { async fn beacon_get() {
ApiTester::new().test_beacon_genesis().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_states_root() {
ApiTester::new().test_beacon_states_root().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_states_fork() {
ApiTester::new().test_beacon_states_fork().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_states_finality_checkpoints() {
ApiTester::new() ApiTester::new()
.test_beacon_genesis()
.await
.test_beacon_states_root()
.await
.test_beacon_states_fork()
.await
.test_beacon_states_finality_checkpoints() .test_beacon_states_finality_checkpoints()
.await; .await
} .test_beacon_states_validators()
.await
#[tokio::test(core_threads = 2)] .test_beacon_states_committees()
async fn beacon_states_validators() { .await
ApiTester::new().test_beacon_states_validators().await; .test_beacon_states_validator_id()
} .await
#[tokio::test(core_threads = 2)]
async fn beacon_states_committees() {
ApiTester::new().test_beacon_states_committees().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_states_validator_id() {
ApiTester::new().test_beacon_states_validator_id().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_headers() {
ApiTester::new()
.test_beacon_headers_all_slots() .test_beacon_headers_all_slots()
.await .await
.test_beacon_headers_all_parents() .test_beacon_headers_all_parents()
.await
.test_beacon_headers_block_id()
.await
.test_beacon_blocks()
.await
.test_beacon_blocks_attestations()
.await
.test_beacon_blocks_root()
.await
.test_get_beacon_pool_attestations()
.await
.test_get_beacon_pool_attester_slashings()
.await
.test_get_beacon_pool_proposer_slashings()
.await
.test_get_beacon_pool_voluntary_exits()
.await; .await;
} }
#[tokio::test(core_threads = 2)]
async fn beacon_headers_block_id() {
ApiTester::new().test_beacon_headers_block_id().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_blocks() {
ApiTester::new().test_beacon_blocks().await;
}
#[tokio::test(core_threads = 2)] #[tokio::test(core_threads = 2)]
async fn post_beacon_blocks_valid() { async fn post_beacon_blocks_valid() {
ApiTester::new().test_post_beacon_blocks_valid().await; ApiTester::new().test_post_beacon_blocks_valid().await;
@ -1725,29 +1710,6 @@ async fn post_beacon_blocks_invalid() {
ApiTester::new().test_post_beacon_blocks_invalid().await; ApiTester::new().test_post_beacon_blocks_invalid().await;
} }
#[tokio::test(core_threads = 2)]
async fn beacon_blocks_root() {
ApiTester::new().test_beacon_blocks_root().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_blocks_attestations() {
ApiTester::new().test_beacon_blocks_attestations().await;
}
#[tokio::test(core_threads = 2)]
async fn beacon_pools_get() {
ApiTester::new()
.test_get_beacon_pool_attestations()
.await
.test_get_beacon_pool_attester_slashings()
.await
.test_get_beacon_pool_proposer_slashings()
.await
.test_get_beacon_pool_voluntary_exits()
.await;
}
#[tokio::test(core_threads = 2)] #[tokio::test(core_threads = 2)]
async fn beacon_pools_post_attestations_valid() { async fn beacon_pools_post_attestations_valid() {
ApiTester::new() ApiTester::new()