Skip to content

Commit

Permalink
Revert run_indy deletion, run proxy tests with run_indy
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
  • Loading branch information
mirgee committed May 15, 2023
1 parent f72ebe6 commit 5630ddf
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 35 deletions.
4 changes: 2 additions & 2 deletions aries_vcx/src/common/anoncreds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_prover_get_credentials() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let proof_req = json!({
"nonce":"123432421212",
"name":"proof_req_1",
Expand Down Expand Up @@ -60,7 +60,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_revoke_credential() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let (_, _, _, _, _, _, _, _, rev_reg_id, cred_rev_id, _, rev_reg) = create_and_store_credential(
Expand Down
6 changes: 3 additions & 3 deletions aries_vcx/src/common/credentials/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_prover_get_credential() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let res = create_and_store_credential(
Expand Down Expand Up @@ -85,7 +85,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_get_cred_rev_id() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let res = create_and_store_credential(
Expand All @@ -108,7 +108,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_is_cred_revoked() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let res = create_and_store_credential(
Expand Down
4 changes: 2 additions & 2 deletions aries_vcx/src/common/primitives/credential_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_create_cred_def_real() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let (schema_id, _) =
create_and_write_test_schema(&setup.profile, &setup.institution_did, DEFAULT_SCHEMA_ATTRS).await;

Expand Down Expand Up @@ -322,7 +322,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_create_rev_reg_def() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let (schema_id, _) =
create_and_write_test_schema(&setup.profile, &setup.institution_did, DEFAULT_SCHEMA_ATTRS).await;
let ledger = Arc::clone(&setup.profile).inject_ledger();
Expand Down
10 changes: 5 additions & 5 deletions aries_vcx/src/common/primitives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod integration_tests {
#[ignore]
async fn test_pool_rev_reg_def_fails_for_cred_def_created_without_revocation() {
// todo: does not need agency setup
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
// Cred def is created with support_revocation=false,
// revoc_reg_def will fail in libindy because cred_Def doesn't have revocation keys
let (_, _, cred_def_id, _, _) = create_and_store_nonrevocable_credential_def(
Expand Down Expand Up @@ -49,7 +49,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_get_rev_reg_def_json() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let attrs = r#"["address1","address2","city","state","zip"]"#;
let (_, _, _, _, rev_reg_id, _, _) =
create_and_store_credential_def(&setup.profile, &setup.institution_did, attrs).await;
Expand All @@ -63,7 +63,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_get_rev_reg_delta_json() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let attrs = r#"["address1","address2","city","state","zip"]"#;
let (_, _, _, _, rev_reg_id, _, _) =
create_and_store_credential_def(&setup.profile, &setup.institution_did, attrs).await;
Expand All @@ -79,7 +79,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_get_rev_reg() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let attrs = r#"["address1","address2","city","state","zip"]"#;
let (_, _, _, _, rev_reg_id, _, _) =
create_and_store_credential_def(&setup.profile, &setup.institution_did, attrs).await;
Expand All @@ -98,7 +98,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_get_cred_def() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let attrs = r#"["address1","address2","city","state","zip"]"#;
let (_, _, cred_def_id, cred_def_json, _) =
create_and_store_nonrevocable_credential_def(&setup.profile, &setup.institution_did, attrs).await;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_create_rev_reg_delta_from_ledger() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let attrs = r#"["address1","address2","city","state","zip"]"#;
let (_, _, _, _, rev_reg_id, _, _) =
create_and_store_credential_def(&setup.profile, &setup.institution_did, attrs).await;
Expand Down
10 changes: 5 additions & 5 deletions aries_vcx/src/common/proofs/verifier/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub mod unit_tests {
#[tokio::test]
#[ignore]
async fn test_pool_proof_restrictions() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let requested_attrs = json!([
Expand Down Expand Up @@ -218,7 +218,7 @@ pub mod unit_tests {
#[tokio::test]
#[ignore]
async fn test_pool_proof_validate_attribute() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let requested_attrs = json!([
Expand Down Expand Up @@ -334,7 +334,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_prover_verify_proof() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let (schemas, cred_defs, proof_req, proof) =
Expand All @@ -354,7 +354,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_prover_verify_proof_with_predicate_success_case() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let (schemas, cred_defs, proof_req, proof) =
Expand All @@ -374,7 +374,7 @@ pub mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_pool_prover_verify_proof_with_predicate_fail_case() {
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

let (schemas, cred_defs, proof_req, proof) =
Expand Down
6 changes: 5 additions & 1 deletion aries_vcx/src/utils/devsetup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,15 @@ impl SetupProfile {

// FUTURE - ideally no tests should be using this method, they should be using the generic run
// after modular profile Anoncreds/Ledger methods have all been implemented, all tests should use run()
#[cfg(feature = "vdrtools")]
#[cfg(any(feature = "vdrtools", feature = "vdr_proxy_ledger"))]
pub async fn run_indy<F>(f: impl FnOnce(Self) -> F)
where
F: Future<Output = ()>,
{
#[cfg(feature = "vdr_proxy_ledger")]
let init = Self::init_vdr_proxy_ledger().await;

#[cfg(all(feature = "vdrtools", not(feature = "vdr_proxy_ledger")))]
let init = Self::init_indy().await;

let teardown = Arc::clone(&init.teardown);
Expand Down
21 changes: 7 additions & 14 deletions aries_vcx/tests/test_creds_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_retrieve_credentials() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let holder_setup = init_holder_setup_in_indy_context(&setup).await;

create_and_store_nonrevocable_credential(
Expand Down Expand Up @@ -68,8 +67,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_get_credential_def() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let (_, _, cred_def_id, cred_def_json, _) = create_and_store_nonrevocable_credential_def(
&setup.profile,
&setup.institution_did,
Expand All @@ -90,8 +88,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_retrieve_credentials_empty() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let mut req = json!({
"nonce":"123432421212",
"name":"proof_req_1",
Expand Down Expand Up @@ -147,8 +144,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_case_for_proof_req_doesnt_matter_for_retrieve_creds() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
create_and_store_nonrevocable_credential(
&setup.profile,
&setup.profile,
Expand Down Expand Up @@ -244,8 +240,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_generate_proof() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
create_and_store_credential(
&setup.profile,
&setup.profile,
Expand Down Expand Up @@ -325,8 +320,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_generate_proof_with_predicates() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
create_and_store_credential(
&setup.profile,
&setup.profile,
Expand Down Expand Up @@ -410,8 +404,7 @@ mod integration_tests {
#[tokio::test]
#[ignore]
async fn test_agency_pool_generate_self_attested_proof() {
// todo - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let indy_proof_req = json!({
"nonce":"123432421212",
"name":"proof_req_1",
Expand Down
4 changes: 2 additions & 2 deletions aries_vcx/tests/test_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod integration_tests {
#[ignore]
async fn test_pool_get_credential_def() {
// TODO - use SetupProfile::run after modular impls
SetupProfile::run(|setup| async move {
SetupProfile::run_indy(|setup| async move {
let (_, _, cred_def_id, cred_def_json, _) = create_and_store_nonrevocable_credential_def(
&setup.profile,
&setup.institution_did,
Expand Down Expand Up @@ -71,7 +71,7 @@ mod integration_tests {
// TODO - future - bring back after all endorser methods added to baseledger
// #[tokio::test]
// async fn test_endorse_transaction() {
// SetupProfile::run(|setup| async move {
// SetupProfile::run_indy(|setup| async move {
// let ledger = Arc::clone(&setup.profile).inject_ledger();
// let (author_did, _) = add_new_did(&setup.profile, &setup.institution_did, None).await.unwrap();
// let (endorser_did, _) = add_new_did(&setup.profile, &setup.institution_did, Some("ENDORSER")).await.unwrap();
Expand Down

0 comments on commit 5630ddf

Please sign in to comment.