-
Notifications
You must be signed in to change notification settings - Fork 9
test_harness - additional multichain tests #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
elpiel
merged 20 commits into
aip-61-adex-v5
from
test_harness-additional-multichain-tests
May 29, 2022
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
18510f6
WIP tests for units-for-slot route
elpiel 837b512
test_harness - multichain tests for CAMPAIGN_3
elpiel 9bd511d
primitives - UnifiedNum:
elpiel ce7d506
primitives - UnifiedNum - try to fix div_floor
elpiel 12c12f9
primitives - UnifiedNum - fix bugs with:
elpiel 2115a0a
UnifiedNum - fix div_floor and add more tests
elpiel 1fb5c4d
primitives - UnifiedNum - use from_whole when mul with u64
elpiel 9235ec2
sentry - fix tests related to UnifiedNum & fees
elpiel f425a3e
worker - fix get_health calculation
elpiel 02c778c
Merge branch 'bugfix-unified-num-math-operations' into test_harness-a…
elpiel f5c2ddc
primitives - clean up UnifiedNum & fix warnings
elpiel eeed4ea
Merge branch 'aip-61-adex-v5' into bugfix-unified-num-math-operations
elpiel 4011455
test_harness - update tests and calculations
elpiel 0669928
Merge branch 'bugfix-unified-num-math-operations' into test_harness-a…
elpiel 1bc3d84
Merge branch 'bugfix-unified-num-math-operations' into test_harness-a…
elpiel 2feeb3a
test_harness - test more states on CAMPAIGN_2:
elpiel b3ad0af
test_harness - fix assertions with timestamp for Validator Messages
elpiel e204050
sentry - fix drop of Object holding the Pools
elpiel df3f61c
Merge branch 'aip-61-adex-v5' into test_harness-additional-multichain…
elpiel 30fc79c
remove WIP units-for-slot tests
elpiel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -491,13 +491,15 @@ pub struct Auth { | |
|
||
#[cfg(test)] | ||
pub mod test_util { | ||
use std::ops; | ||
|
||
use adapter::{ | ||
dummy::{Dummy, Options}, | ||
Adapter, | ||
}; | ||
use primitives::{ | ||
config::GANACHE_CONFIG, | ||
test_util::{discard_logger, CREATOR, FOLLOWER, IDS, LEADER}, | ||
test_util::{discard_logger, DUMMY_AUTH, IDS, LEADER}, | ||
}; | ||
|
||
use crate::{ | ||
|
@@ -510,19 +512,38 @@ pub mod test_util { | |
Application, | ||
}; | ||
|
||
/// This guard holds the Redis and Postgres pools taken from their respective Pool of pools. | ||
/// | ||
/// This ensures that they will not be dropped which will cause tests to fail randomly. | ||
pub struct ApplicationGuard { | ||
pub app: Application<Dummy>, | ||
#[allow(dead_code)] | ||
redis_pool: deadpool::managed::Object<crate::db::redis_pool::Manager>, | ||
#[allow(dead_code)] | ||
db_pool: deadpool::managed::Object<crate::db::tests_postgres::Manager>, | ||
Comment on lines
+521
to
+523
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the |
||
} | ||
|
||
impl ops::Deref for ApplicationGuard { | ||
type Target = Application<Dummy>; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.app | ||
} | ||
} | ||
impl ops::DerefMut for ApplicationGuard { | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.app | ||
} | ||
} | ||
|
||
/// Uses development and therefore the goerli testnet addresses of the tokens | ||
/// It still uses DummyAdapter. | ||
pub async fn setup_dummy_app() -> Application<Dummy> { | ||
/// but still uses the `DummyAdapter`. | ||
pub async fn setup_dummy_app() -> ApplicationGuard { | ||
let config = GANACHE_CONFIG.clone(); | ||
|
||
let adapter = Adapter::new(Dummy::init(Options { | ||
dummy_identity: IDS[&LEADER], | ||
dummy_auth_tokens: vec![ | ||
(*CREATOR, "AUTH_Creator".into()), | ||
(*LEADER, "AUTH_Leader".into()), | ||
(*FOLLOWER, "AUTH_Follower".into()), | ||
] | ||
.into_iter() | ||
.collect(), | ||
dummy_auth_tokens: DUMMY_AUTH.clone(), | ||
})); | ||
|
||
let redis = TESTS_POOL.get().await.expect("Should return Object"); | ||
|
@@ -550,6 +571,10 @@ pub mod test_util { | |
platform_api, | ||
); | ||
|
||
app | ||
ApplicationGuard { | ||
app, | ||
redis_pool: redis, | ||
db_pool: database, | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still get timeouts in test_harness sometimes, we have to check why this is - performance issue or something wrong with the services