diff --git a/.vscode/settings.json b/.vscode/settings.json index 798ee63b1d..69ccb671c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -113,6 +113,7 @@ "pyproject", "pypy", "pytest", + "pytestmark", "PYTHONPATH", "pyyaml", "redoc", diff --git a/app/services/onboarding/issuer.py b/app/services/onboarding/issuer.py index 022ac8fb0d..55cba84290 100644 --- a/app/services/onboarding/issuer.py +++ b/app/services/onboarding/issuer.py @@ -32,7 +32,9 @@ async def onboard_issuer( endorser_controller (AcaPyClient): authenticated ACA-Py client for endorser issuer_label (str): alias for the issuer """ - bound_logger = logger.bind(body={"issuer_wallet_id": issuer_wallet_id}) + bound_logger = logger.bind( + body={"issuer_label": issuer_label, "issuer_wallet_id": issuer_wallet_id} + ) bound_logger.debug("Onboarding issuer") try: @@ -92,7 +94,9 @@ async def onboard_issuer_no_public_did( Returns: issuer_did (DID): The issuer's DID after completing the onboarding process """ - bound_logger = logger.bind(body={"issuer_wallet_id": issuer_wallet_id}) + bound_logger = logger.bind( + body={"issuer_label": issuer_label, "issuer_wallet_id": issuer_wallet_id} + ) bound_logger.debug("Onboarding issuer that has no public DID") try: diff --git a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_bbs.py b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_bbs.py index c5c5b60aa0..8797455af4 100644 --- a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_bbs.py +++ b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_bbs.py @@ -2,16 +2,10 @@ from copy import deepcopy import pytest -from aries_cloudcontroller import ( - AcaPyClient, - Credential, - LDProofVCDetail, - LDProofVCOptions, -) +from aries_cloudcontroller import AcaPyClient from assertpy import assert_that from fastapi import HTTPException -from app.models.issuer import SendCredential from app.routes.connections import router as conn_router from app.routes.issuer import router as issuer_router from app.routes.oob import router as oob_router @@ -19,59 +13,16 @@ from app.tests.util.webhooks import assert_both_webhooks_received, check_webhook_state from shared import RichAsyncClient +from .util import create_credential + +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_3") + CREDENTIALS_BASE_PATH = issuer_router.prefix OOB_BASE_PATH = oob_router.prefix CONNECTIONS_BASE_PATH = conn_router.prefix - -credential_ = SendCredential( - type="ld_proof", - connection_id="", - ld_credential_detail=LDProofVCDetail( - credential=Credential( - context=[ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1", - ], - type=["VerifiableCredential", "UniversityDegreeCredential"], - credentialSubject={ - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science and Arts", - }, - "college": "Faber College", - }, - issuanceDate="2021-04-12", - issuer="", - ), - options=LDProofVCOptions(proofType="BbsBlsSignature2020"), - ), -).model_dump(by_alias=True, exclude_unset=True) - -# This is the json of the below credential -# { -# "type": "ld_proof", -# "connection_id": "", -# "ld_credential_detail": { -# "credential": { -# "@context": [ -# "https://www.w3.org/2018/credentials/v1", -# "https://www.w3.org/2018/credentials/examples/v1", -# ], -# "type": ["VerifiableCredential", "UniversityDegreeCredential"], -# "credentialSubject": { -# "degree": { -# "type": "BachelorDegree", -# "name": "Bachelor of Science and Arts", -# }, -# "college": "Faber College", -# }, -# "issuanceDate": "2021-04-12", -# "issuer": "", -# }, -# "options": "", -# }, -# } +credential_ = create_credential("BbsBlsSignature2020") @pytest.mark.anyio @@ -96,13 +47,12 @@ async def test_send_jsonld_key_bbs( ) data = response.json() + assert_that(data).contains("credential_exchange_id") + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] try: thread_id = data["thread_id"] - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - assert await check_webhook_state( client=alice_member_client, topic="credentials", @@ -194,12 +144,11 @@ async def test_send_jsonld_bbs_oob( ) data = response.json() + assert_that(data).contains("credential_exchange_id") + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] try: - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - assert await check_webhook_state( client=alice_member_client, topic="credentials", diff --git a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_ed25519.py b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_ed25519.py index a709c1f6a0..7fa447cc66 100644 --- a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_ed25519.py +++ b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_key_ed25519.py @@ -2,11 +2,9 @@ from copy import deepcopy import pytest -from aries_cloudcontroller import Credential, LDProofVCDetail, LDProofVCOptions from assertpy import assert_that from fastapi import HTTPException -from app.models.issuer import SendCredential from app.routes.connections import router as conn_router from app.routes.issuer import router as issuer_router from app.routes.oob import router as oob_router @@ -14,58 +12,16 @@ from app.tests.util.webhooks import assert_both_webhooks_received, check_webhook_state from shared import RichAsyncClient +from .util import create_credential + +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_4") + CREDENTIALS_BASE_PATH = issuer_router.prefix OOB_BASE_PATH = oob_router.prefix CONNECTIONS_BASE_PATH = conn_router.prefix -credential_ = SendCredential( - type="ld_proof", - connection_id="", - ld_credential_detail=LDProofVCDetail( - credential=Credential( - context=[ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1", - ], - type=["VerifiableCredential", "UniversityDegreeCredential"], - credentialSubject={ - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science and Arts", - }, - "college": "Faber College", - }, - issuanceDate="2021-04-12", - issuer="", - ), - options=LDProofVCOptions(proofType="Ed25519Signature2018"), - ), -).model_dump(by_alias=True, exclude_unset=True) - -# This is the json of the above credential -# { -# "type": "ld_proof", -# "connection_id": "", -# "ld_credential_detail": { -# "credential": { -# "@context": [ -# "https://www.w3.org/2018/credentials/v1", -# "https://www.w3.org/2018/credentials/examples/v1", -# ], -# "type": ["VerifiableCredential", "UniversityDegreeCredential"], -# "credentialSubject": { -# "degree": { -# "type": "BachelorDegree", -# "name": "Bachelor of Science and Arts", -# }, -# "college": "Faber College", -# }, -# "issuanceDate": "2021-04-12", -# "issuer": "", -# }, -# "options": "", -# }, -# } +credential_ = create_credential("Ed25519Signature2018") @pytest.mark.anyio @@ -92,13 +48,11 @@ async def test_send_jsonld_key_ed25519( ) data = response.json() + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] try: thread_id = data["thread_id"] - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - assert await check_webhook_state( client=alice_member_client, topic="credentials", @@ -192,12 +146,11 @@ async def test_send_jsonld_oob( ) data = response.json() + assert_that(data).contains("credential_exchange_id") + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] try: - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - assert await check_webhook_state( client=alice_member_client, topic="credentials", diff --git a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_sov.py b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_sov.py index eff0a9a2ee..adcbc55c89 100644 --- a/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_sov.py +++ b/app/tests/e2e/issuer/ld_proof/test_ld_proof_did_sov.py @@ -2,15 +2,9 @@ from copy import deepcopy import pytest -from aries_cloudcontroller import ( - AcaPyClient, - Credential, - LDProofVCDetail, - LDProofVCOptions, -) +from aries_cloudcontroller import AcaPyClient from assertpy import assert_that -from app.models.issuer import SendCredential from app.routes.issuer import router as issuer_router from app.routes.oob import router as oob_router from app.routes.wallet.dids import router as wallet_router @@ -18,58 +12,16 @@ from app.tests.util.webhooks import assert_both_webhooks_received, check_webhook_state from shared import RichAsyncClient +from .util import create_credential + +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_3") + CREDENTIALS_BASE_PATH = issuer_router.prefix OOB_BASE_PATH = oob_router.prefix WALLET = wallet_router.prefix -credential_ = SendCredential( - type="ld_proof", - connection_id="", - ld_credential_detail=LDProofVCDetail( - credential=Credential( - context=[ - "https://www.w3.org/2018/credentials/v1", - "https://www.w3.org/2018/credentials/examples/v1", - ], - type=["VerifiableCredential", "UniversityDegreeCredential"], - credentialSubject={ - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science and Arts", - }, - "college": "Faber College", - }, - issuanceDate="2021-04-12", - issuer="", - ), - options=LDProofVCOptions(proofType="Ed25519Signature2018"), - ), -).model_dump(by_alias=True, exclude_unset=True) - -# This is the json of the above credential -# { -# "type": "ld_proof", -# "connection_id": "", -# "ld_credential_detail": { -# "credential": { -# "@context": [ -# "https://www.w3.org/2018/credentials/v1", -# "https://www.w3.org/2018/credentials/examples/v1", -# ], -# "type": ["VerifiableCredential", "UniversityDegreeCredential"], -# "credentialSubject": { -# "degree": { -# "type": "BachelorDegree", -# "name": "Bachelor of Science and Arts", -# }, -# "college": "Faber College", -# }, -# "issuanceDate": "2021-04-12", -# "issuer": "", -# }, -# "options": "", -# }, -# } +credential_ = create_credential("Ed25519Signature2018") @pytest.mark.anyio @@ -98,13 +50,12 @@ async def test_send_jsonld_credential_sov( ) data = response.json() + assert_that(data).contains("credential_exchange_id") + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] try: thread_id = data["thread_id"] - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - assert await check_webhook_state( client=alice_member_client, topic="credentials", @@ -162,13 +113,12 @@ async def test_send_jsonld_oob_sov( ) data = response.json() + assert_that(data).contains("credential_exchange_id") + assert_that(data).has_state("offer-sent") cred_ex_id = data["credential_exchange_id"] - thread_id = data["thread_id"] try: - assert_that(data).contains("credential_exchange_id") - assert_that(data).has_state("offer-sent") - + thread_id = data["thread_id"] invitation_response = await faber_client.post( OOB_BASE_PATH + "/create-invitation", json={ diff --git a/app/tests/e2e/issuer/ld_proof/util.py b/app/tests/e2e/issuer/ld_proof/util.py new file mode 100644 index 0000000000..c48e38923e --- /dev/null +++ b/app/tests/e2e/issuer/ld_proof/util.py @@ -0,0 +1,29 @@ +from aries_cloudcontroller import Credential, LDProofVCDetail, LDProofVCOptions + +from app.models.issuer import SendCredential + + +def create_credential(proof_type: str) -> dict: + return SendCredential( + type="ld_proof", + connection_id="", + ld_credential_detail=LDProofVCDetail( + credential=Credential( + context=[ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + ], + type=["VerifiableCredential", "UniversityDegreeCredential"], + credentialSubject={ + "degree": { + "type": "BachelorDegree", + "name": "Bachelor of Science and Arts", + }, + "college": "Faber College", + }, + issuanceDate="2021-04-12", + issuer="", + ), + options=LDProofVCOptions(proofType=proof_type), + ), + ).model_dump(by_alias=True, exclude_unset=True) diff --git a/app/tests/e2e/issuer/test_connections_use_public_did.py b/app/tests/e2e/issuer/test_connections_use_public_did.py index c05a3e37a0..5f22540721 100644 --- a/app/tests/e2e/issuer/test_connections_use_public_did.py +++ b/app/tests/e2e/issuer/test_connections_use_public_did.py @@ -10,6 +10,7 @@ @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_accept_use_public_did( faber_client: RichAsyncClient, # issuer has public did meld_co_client: RichAsyncClient, # also has public did @@ -54,6 +55,7 @@ async def test_accept_use_public_did( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_accept_use_public_did_between_issuer_and_holder( faber_client: RichAsyncClient, # issuer has public did alice_member_client: RichAsyncClient, # no public did diff --git a/app/tests/e2e/issuer/test_get_records_paginated.py b/app/tests/e2e/issuer/test_get_records_paginated.py index c82a4a0bd7..704985217a 100644 --- a/app/tests/e2e/issuer/test_get_records_paginated.py +++ b/app/tests/e2e/issuer/test_get_records_paginated.py @@ -16,6 +16,7 @@ TestMode.regression_run in TestMode.fixture_params, reason="Temporarily skip; existing tests on dev don't clean up old records yet", ) +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_get_credential_exchange_records_paginated( faber_client: RichAsyncClient, alice_member_client: RichAsyncClient, diff --git a/app/tests/e2e/issuer/test_indy_credentials.py b/app/tests/e2e/issuer/test_indy_credentials.py index 781a3619db..fd1ad6b533 100644 --- a/app/tests/e2e/issuer/test_indy_credentials.py +++ b/app/tests/e2e/issuer/test_indy_credentials.py @@ -11,6 +11,9 @@ from app.tests.util.webhooks import check_webhook_state from shared import RichAsyncClient +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_2") + CREDENTIALS_BASE_PATH = issuer_router.prefix OOB_BASE_PATH = oob_router.prefix diff --git a/app/tests/e2e/issuer/test_save_exchange_record.py b/app/tests/e2e/issuer/test_save_exchange_record.py index 2b27888d7e..48fbff9972 100644 --- a/app/tests/e2e/issuer/test_save_exchange_record.py +++ b/app/tests/e2e/issuer/test_save_exchange_record.py @@ -17,6 +17,7 @@ @pytest.mark.anyio @pytest.mark.parametrize("save_exchange_record", [None, False, True]) +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_issue_credential_with_save_exchange_record( faber_client: RichAsyncClient, credential_definition_id: str, @@ -111,6 +112,7 @@ async def test_issue_credential_with_save_exchange_record( @pytest.mark.anyio @pytest.mark.parametrize("save_exchange_record", [None, False, True]) +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_request_credential_with_save_exchange_record( faber_client: RichAsyncClient, credential_definition_id: str, @@ -205,6 +207,7 @@ async def test_request_credential_with_save_exchange_record( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_get_cred_exchange_records( faber_client: RichAsyncClient, credential_definition_id: str, diff --git a/app/tests/e2e/test_definitions.py b/app/tests/e2e/test_definitions.py index 8f29613205..1698ba0313 100644 --- a/app/tests/e2e/test_definitions.py +++ b/app/tests/e2e/test_definitions.py @@ -155,6 +155,7 @@ async def test_get_credential_definition( "but it fails when run a 2nd time in regression mode" ), ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_create_credential_definition_issuer_tenant( schema_definition: CredentialSchema, faber_acapy_client: AcaPyClient, diff --git a/app/tests/e2e/test_did_exchange.py b/app/tests/e2e/test_did_exchange.py index 8c3aa54d1a..7a0bad13f7 100644 --- a/app/tests/e2e/test_did_exchange.py +++ b/app/tests/e2e/test_did_exchange.py @@ -29,6 +29,7 @@ (None, None, True), ], ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_create_did_exchange_request( alice_member_client: RichAsyncClient, faber_client: RichAsyncClient, @@ -113,6 +114,7 @@ async def test_create_did_exchange_request( "This test works in isolation. Should be refactored to run in parallel." ) @pytest.mark.parametrize("use_public_did", [False]) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_accept_did_exchange_invitation( alice_member_client: RichAsyncClient, faber_client: RichAsyncClient, diff --git a/app/tests/e2e/test_did_rotate.py b/app/tests/e2e/test_did_rotate.py index aece81e903..9f56d57400 100644 --- a/app/tests/e2e/test_did_rotate.py +++ b/app/tests/e2e/test_did_rotate.py @@ -15,6 +15,7 @@ @pytest.mark.anyio @pytest.mark.parametrize("did_method", ["did:peer:2", "did:peer:4"]) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_rotate_did( alice_member_client: RichAsyncClient, alice_acapy_client: AcaPyClient, @@ -55,6 +56,7 @@ async def test_rotate_did( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_hangup_did_rotation( alice_member_client: RichAsyncClient, faber_client: RichAsyncClient, diff --git a/app/tests/e2e/test_jsonld.py b/app/tests/e2e/test_jsonld.py index 50f6d03879..b427558279 100644 --- a/app/tests/e2e/test_jsonld.py +++ b/app/tests/e2e/test_jsonld.py @@ -53,6 +53,7 @@ @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_sign_jsonld( faber_acapy_client: AcaPyClient, faber_client: RichAsyncClient, @@ -126,6 +127,7 @@ async def test_sign_jsonld( @pytest.mark.skip("Model validation is overly strict again. To be reviewed") @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_verify_jsonld( alice_member_client: RichAsyncClient, faber_acapy_client: AcaPyClient, diff --git a/app/tests/e2e/test_oob.py b/app/tests/e2e/test_oob.py index 15d3047ac8..b98d6b16c8 100644 --- a/app/tests/e2e/test_oob.py +++ b/app/tests/e2e/test_oob.py @@ -68,6 +68,7 @@ async def test_accept_invitation_oob( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_oob_connect_via_public_did( bob_member_client: RichAsyncClient, faber_acapy_client: AcaPyClient, diff --git a/app/tests/e2e/test_proof_request_models.py b/app/tests/e2e/test_proof_request_models.py index c033ce5606..4ca1352314 100644 --- a/app/tests/e2e/test_proof_request_models.py +++ b/app/tests/e2e/test_proof_request_models.py @@ -24,6 +24,7 @@ (None, None), ], ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_proof_model_failures( issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument acme_acapy_client: AcaPyClient, diff --git a/app/tests/e2e/test_revocation.py b/app/tests/e2e/test_revocation.py index 442236cf65..475dfc604f 100644 --- a/app/tests/e2e/test_revocation.py +++ b/app/tests/e2e/test_revocation.py @@ -9,6 +9,9 @@ from shared import RichAsyncClient from shared.models.credential_exchange import CredentialExchange +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_2") + REVOCATION_BASE_PATH = router.prefix VERIFIER_BASE_PATH = verifier_router.prefix @@ -168,16 +171,7 @@ async def test_publish_all_revocations_for_rev_reg_id( json={"revocation_registry_credential_map": {rev_reg_id: []}}, ) - for cred in revoke_alice_creds: - rev_record = ( - await faber_client.get( - f"{REVOCATION_BASE_PATH}/revocation/record" - + "?credential_exchange_id=" - + cred.credential_exchange_id - ) - ).json() - - assert rev_record["state"] == "revoked" + await check_revocation_status(faber_client, revoke_alice_creds, "revoked") @pytest.mark.anyio @@ -194,16 +188,24 @@ async def test_publish_all_revocations_no_payload( json={"revocation_registry_credential_map": {}}, ) - for cred in revoke_alice_creds: + await check_revocation_status(faber_client, revoke_alice_creds, "revoked") + + +async def check_revocation_status( + client: RichAsyncClient, + credentials: List[CredentialExchange], + expected_state: str, +): + for cred in credentials: rev_record = ( - await faber_client.get( + await client.get( f"{REVOCATION_BASE_PATH}/revocation/record" + "?credential_exchange_id=" + cred.credential_exchange_id ) ).json() - assert rev_record["state"] == "revoked" + assert rev_record["state"] == expected_state @pytest.mark.anyio diff --git a/app/tests/e2e/test_tenants.py b/app/tests/e2e/test_tenants.py index 983961b896..1205567d7c 100644 --- a/app/tests/e2e/test_tenants.py +++ b/app/tests/e2e/test_tenants.py @@ -176,6 +176,7 @@ async def test_create_tenant_member_w_wallet_name( TestMode.regression_run in TestMode.fixture_params, reason=skip_regression_test_reason, ) +@pytest.mark.xdist_group(name="issuer_test_group_5") async def test_create_tenant_issuer( tenant_admin_client: RichAsyncClient, tenant_admin_acapy_client: AcaPyClient, @@ -320,6 +321,7 @@ async def test_create_tenant_verifier( TestMode.regression_run in TestMode.fixture_params, reason=skip_regression_test_reason, ) +@pytest.mark.xdist_group(name="issuer_test_group_5") async def test_update_tenant_verifier_to_issuer( tenant_admin_client: RichAsyncClient, tenant_admin_acapy_client: AcaPyClient, diff --git a/app/tests/e2e/test_trust_registry.py b/app/tests/e2e/test_trust_registry.py index 4847b1c4a8..9794972a6c 100644 --- a/app/tests/e2e/test_trust_registry.py +++ b/app/tests/e2e/test_trust_registry.py @@ -12,6 +12,7 @@ @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_schemas( schema_definition: CredentialSchema, # pylint: disable=unused-argument schema_definition_alt: CredentialSchema, # pylint: disable=unused-argument @@ -27,6 +28,7 @@ async def test_get_schemas( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_schema_by_id( schema_definition: CredentialSchema, trust_registry_client: RichAsyncClient ): @@ -47,6 +49,7 @@ async def test_get_schema_by_id( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_actors( faber_issuer: CreateTenantResponse, faber_acapy_client: AcaPyClient, @@ -118,6 +121,7 @@ async def test_get_actors_x(trust_registry_client: RichAsyncClient): @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_issuers( faber_issuer: CreateTenantResponse, # pylint: disable=unused-argument trust_registry_client: RichAsyncClient, diff --git a/app/tests/e2e/test_wallet_credentials.py b/app/tests/e2e/test_wallet_credentials.py index ca3f88db29..210597ea3a 100644 --- a/app/tests/e2e/test_wallet_credentials.py +++ b/app/tests/e2e/test_wallet_credentials.py @@ -23,6 +23,7 @@ async def test_get_credentials(alice_member_client: RichAsyncClient): TestMode.regression_run in TestMode.fixture_params, reason="Don't delete credentials in regression run", ) +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_get_and_delete_credential_record( alice_member_client: RichAsyncClient, issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument @@ -70,6 +71,7 @@ async def test_get_and_delete_credential_record( @pytest.mark.parametrize( "issue_alice_many_creds", [3], indirect=True ) # issue alice 3 creds +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_get_credential_record_with_limit( alice_member_client: RichAsyncClient, issue_alice_many_creds: List[CredentialExchange], # pylint: disable=unused-argument diff --git a/app/tests/e2e/verifier/test_get_credentials_by_proof_id.py b/app/tests/e2e/verifier/test_get_credentials_by_proof_id.py index 105a27c3eb..150fd40032 100644 --- a/app/tests/e2e/verifier/test_get_credentials_by_proof_id.py +++ b/app/tests/e2e/verifier/test_get_credentials_by_proof_id.py @@ -18,6 +18,7 @@ TestMode.regression_run in TestMode.fixture_params, reason="Temporarily skip; existing tests on dev don't clean up old records yet", ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_limit_and_offset( issue_alice_creds: List[CredentialExchange], # pylint: disable=unused-argument acme_and_alice_connection: AcmeAliceConnect, diff --git a/app/tests/e2e/verifier/test_get_records_paginated.py b/app/tests/e2e/verifier/test_get_records_paginated.py index c9010dcfbe..6e40bef84d 100644 --- a/app/tests/e2e/verifier/test_get_records_paginated.py +++ b/app/tests/e2e/verifier/test_get_records_paginated.py @@ -18,6 +18,7 @@ TestMode.regression_run in TestMode.fixture_params, reason="Temporarily skip; existing tests on dev don't clean up old records yet", ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_presentation_exchange_records_paginated( acme_client: RichAsyncClient, alice_member_client: RichAsyncClient, diff --git a/app/tests/e2e/verifier/test_many_revocations.py b/app/tests/e2e/verifier/test_many_revocations.py index 9509ef6307..f9cb4b443f 100644 --- a/app/tests/e2e/verifier/test_many_revocations.py +++ b/app/tests/e2e/verifier/test_many_revocations.py @@ -19,6 +19,7 @@ @pytest.mark.anyio @pytest.mark.skip("This test exists for local testing") @pytest.mark.parametrize("revoke_many", ["auto_publish_true"], indirect=True) +@pytest.mark.xdist_group(name="issuer_test_group_2") async def test_revoke_many_credentials( revoke_many: List[ # pylint: disable=unused-argument, redefined-outer-name CredentialExchange diff --git a/app/tests/e2e/verifier/test_predicate_proofs.py b/app/tests/e2e/verifier/test_predicate_proofs.py index f1b42a0bbc..cd0713f682 100644 --- a/app/tests/e2e/verifier/test_predicate_proofs.py +++ b/app/tests/e2e/verifier/test_predicate_proofs.py @@ -15,6 +15,7 @@ @pytest.mark.anyio @pytest.mark.parametrize("predicate", ["<", ">", "<=", ">="]) +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_predicate_proofs( acme_client: RichAsyncClient, acme_and_alice_connection: AcmeAliceConnect, diff --git a/app/tests/e2e/verifier/test_proof_revoked_credential.py b/app/tests/e2e/verifier/test_proof_revoked_credential.py index a40cc677c9..d3a43eb5eb 100644 --- a/app/tests/e2e/verifier/test_proof_revoked_credential.py +++ b/app/tests/e2e/verifier/test_proof_revoked_credential.py @@ -26,6 +26,7 @@ TestMode.regression_run in TestMode.fixture_params, reason="Proving revoked credentials is currently non-deterministic", ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_proof_revoked_credential( revoke_alice_creds_and_publish: List[ # pylint: disable=unused-argument CredentialExchange @@ -119,6 +120,7 @@ async def test_proof_revoked_credential( TestMode.clean_run in TestMode.fixture_params, reason="Run only in regression mode", ) +@pytest.mark.xdist_group(name="issuer_test_group") async def test_regression_proof_revoked_credential( get_or_issue_regression_cred_revoked: ReferentCredDef, acme_client: RichAsyncClient, diff --git a/app/tests/e2e/verifier/test_self_attested.py b/app/tests/e2e/verifier/test_self_attested.py index 22ffc7cdb3..82ad88b65f 100644 --- a/app/tests/e2e/verifier/test_self_attested.py +++ b/app/tests/e2e/verifier/test_self_attested.py @@ -13,6 +13,7 @@ @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_self_attested_attributes( acme_client: RichAsyncClient, acme_and_alice_connection: AcmeAliceConnect, diff --git a/app/tests/e2e/verifier/test_verifier.py b/app/tests/e2e/verifier/test_verifier.py index 7ddbe9381a..0d2674410a 100644 --- a/app/tests/e2e/verifier/test_verifier.py +++ b/app/tests/e2e/verifier/test_verifier.py @@ -68,6 +68,7 @@ async def test_send_proof_request( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_accept_proof_request( issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument alice_member_client: RichAsyncClient, @@ -225,6 +226,7 @@ async def test_reject_proof_request( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group") async def test_get_proof_and_get_proofs( acme_and_alice_connection: AcmeAliceConnect, issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument @@ -409,6 +411,7 @@ async def test_delete_proof( @pytest.mark.anyio +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_get_credentials_for_request( issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument acme_and_alice_connection: AcmeAliceConnect, @@ -465,6 +468,7 @@ async def test_get_credentials_for_request( @pytest.mark.parametrize( "meld_co_and_alice_connection", ["trust_registry", "default"], indirect=True ) +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_accept_proof_request_verifier_has_issuer_role( meld_co_issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument meld_co_credential_definition_id: str, @@ -539,6 +543,7 @@ async def test_accept_proof_request_verifier_has_issuer_role( @pytest.mark.anyio @pytest.mark.parametrize("acme_save_exchange_record", [None, False, True]) @pytest.mark.parametrize("alice_save_exchange_record", [None, False, True]) +@pytest.mark.xdist_group(name="issuer_test_group_4") async def test_saving_of_presentation_exchange_records( issue_credential_to_alice: CredentialExchange, # pylint: disable=unused-argument credential_definition_id: str, @@ -645,6 +650,7 @@ async def test_saving_of_presentation_exchange_records( TestMode.clean_run in TestMode.fixture_params, reason="Run only in regression mode", ) +@pytest.mark.xdist_group(name="issuer_test_group_3") async def test_regression_proof_valid_credential( get_or_issue_regression_cred_valid: ReferentCredDef, acme_client: RichAsyncClient, diff --git a/app/tests/e2e/verifier/test_verifier_oob.py b/app/tests/e2e/verifier/test_verifier_oob.py index 47069e70c1..ccb88f341c 100644 --- a/app/tests/e2e/verifier/test_verifier_oob.py +++ b/app/tests/e2e/verifier/test_verifier_oob.py @@ -19,6 +19,9 @@ from shared import RichAsyncClient from shared.models.credential_exchange import CredentialExchange +# Apply the marker to all tests in this module +pytestmark = pytest.mark.xdist_group(name="issuer_test_group_3") + OOB_BASE_PATH = oob_router.prefix VERIFIER_BASE_PATH = verifier_router.prefix CONNECTIONS_BASE_PATH = connections_router.prefix diff --git a/trustregistry/tests/e2e/test_actor.py b/trustregistry/tests/e2e/test_actor.py index 779f1f9056..bcb4df6080 100644 --- a/trustregistry/tests/e2e/test_actor.py +++ b/trustregistry/tests/e2e/test_actor.py @@ -6,6 +6,9 @@ from shared import TRUST_REGISTRY_URL from shared.util.rich_async_client import RichAsyncClient +# Apply the marker to all tests in this module. Tests must run sequentially in same xdist group. +pytestmark = pytest.mark.xdist_group(name="trust_registry_test_group") + new_actor = { "id": "darth-vader", "name": "Darth Vader", diff --git a/trustregistry/tests/e2e/test_schema.py b/trustregistry/tests/e2e/test_schema.py index 814202e3b5..14381c11eb 100644 --- a/trustregistry/tests/e2e/test_schema.py +++ b/trustregistry/tests/e2e/test_schema.py @@ -4,6 +4,9 @@ from shared.util.rich_async_client import RichAsyncClient from trustregistry.registry.registry_schemas import SchemaID, _get_schema_attrs +# Apply the marker to all tests in this module. Tests must run sequentially in same xdist group. +pytestmark = pytest.mark.xdist_group(name="trust_registry_test_group") + schema_id = "string:2:string:string" updated_schema_id = "string_updated:2:string_updated:string_updated"