Skip to content
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

🧪 Initial regression testing framework #780

Merged
merged 46 commits into from
May 7, 2024
Merged

Conversation

ff137
Copy link
Collaborator

@ff137 ff137 commented Apr 25, 2024

This PR implements regression testing functionality, by utilising fixture parametrization, so existing tests can be run in a "clean_run" or a "regression_run" mode. A clean run will follow the existing logic of creating new members, connections, credentials etc, for each test. A regression run will utilise existing tenants, connections, credentials, etc, to assert that functionality works for existing fixtures.

Usage:

export RUN_REGRESSION_TESTS=true
export SKIP_CLEAN_TESTS=true  # it's possible to run a mix of regression + clean tests, but then it runs every possible combination, of mixing one fixture is clean and this other one reused, etc. About ~3600 tests in total
pytest  # 1st test run

The above env vars will configure test fixtures to create regression test fixtures (i.e. reusable tenants, connections, schemas, and cred defs), if they don't already exist.

After a first test run is complete, you can set the following:

export FAIL_ON_RECREATING_FIXTURES=true
pytest  #2nd test run

This will configure the tests to fail if any fixture is re-created, because after an initial first run, we expect existing fixtures to be re-used in subsequent test runs.

The PR currently skips 3 problematic tests from running in regression mode. They can be investigated in more detail at a later stage. Apart from that, all tests are currently passing in regression mode, in the first initial run, and subsequent runs.

To-do:

  • implement specific tests for re-using already issued credentials, and proving a revoked credential is still revoked, etc

app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/regression/fixtures.py Fixed Show fixed Hide fixed
app/tests/conftest.py Fixed Show fixed Hide fixed
app/tests/conftest.py Fixed Show fixed Hide fixed
@ff137 ff137 self-assigned this Apr 29, 2024
@ff137 ff137 added the tests label Apr 29, 2024
@ff137 ff137 force-pushed the feat/regression_tests branch from 27754ee to f8ae589 Compare April 30, 2024 12:20
app/tests/fixtures/member_connections.py Fixed Show fixed Hide fixed
app/tests/fixtures/member_connections.py Fixed Show fixed Hide fixed
app/tests/fixtures/member_connections.py Fixed Show fixed Hide fixed
app/tests/fixtures/member_connections.py Fixed Show fixed Hide fixed
app/tests/util/connections.py Fixed Show fixed Hide fixed
@ff137 ff137 marked this pull request as ready for review April 30, 2024 13:34
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
app/routes
   connections.py603935%32–48, 64–76, 113–138, 159–173, 188–199
   definitions.py1889251%76–137, 170–171, 238–254, 269–275, 296–305, 328–329, 346–348, 391–445, 472–473, 517–597, 605–624
   issuer.py1733878%92, 128, 167–169, 198, 234–236, 244, 261, 360–370, 401–412, 445–476, 517, 530, 562
   jsonld.py604722%23–93, 104–137
   messaging.py241154%32–41, 61–71
   oob.py462839%27–68, 79–92, 116–127
   verifier.py1473378%64–66, 71, 109–111, 116, 158, 166–168, 173, 207–212, 218–220, 270–272, 278, 311–313, 318, 348–350, 384–386
   webhooks.py16475%32–36, 57–61
   websocket_endpoint.py23865%24–25, 37–42, 54–57, 70–76
app/routes/wallet
   credentials.py775232%32–45, 54–66, 75–86, 95–109, 120–136, 148–162, 171–183, 192–203
   dids.py762271%28–37, 56–57, 79–80, 92–99, 107–115
   jws.py422736%35–60, 76–99
   sd_jws.py422736%36–61, 78–101
app/services
   acapy_ledger.py611280%110–111, 124–140, 196–197
   acapy_wallet.py39490%60–61, 97–98
   revocation_registry.py1321291%317–321, 349, 359–361, 391–395, 420–425
   webhooks.py271833%17–25, 29–39
   websocket.py514120%19–22, 29–36, 47–91
app/services/event_handling
   websocket_manager.py732664%64–68, 87–90, 97–108, 115–125, 139
app/services/issuer
   acapy_issuer_v1.py921485%36, 76–110, 213–214
   acapy_issuer_v2.py1062279%60–63, 87–127, 173, 235–236, 263
app/services/onboarding
   tenants.py584424%30–97, 107–137
   verifier.py37392%67, 83–87
app/services/onboarding/util
   register_issuer_did.py86397%100–102
   set_endorser_metadata.py693746%28–30, 50–52, 76–78, 109–128, 140–149, 161–172, 185–197
app/services/trust_registry
   actors.py107992%94–99, 109, 208–209, 211–216, 281–284
   schemas.py49492%56–61, 91–96
app/services/trust_registry/util
   actor.py31294%26–27
   issuer.py23483%39–40, 48–49
app/tests/e2e
   conftest.py23578%43–51
   test_jsonld.py591673%133–168
   test_tenants.py3341596%167, 211–212, 240, 665, 699–700, 709–710, 719–720, 732–733, 742–743
   test_wallet_dids.py671085%92–107
app/tests/e2e/issuer
   test_save_exchange_record.py60198%142
app/tests/exception_handling
   test_handle_model_with_validation.py23196%22
app/tests/fixtures
   credentials.py57198%156
   member_acapy_clients.py36489%47–50, 73–74
   member_connections.py43881%80–91, 130–141
   member_wallets.py611575%29–34, 49–54, 69–74, 89–94, 111–118
app/tests/services
   test_revocation_registry.py135299%73, 106
app/tests/services/issuer
   test_issuer.py161299%316–319
app/tests/util
   connections.py852669%112–131, 140–157, 174–183, 238–260
   ledger.py491080%34, 42, 54, 62–66, 76, 82
   regression_testing.py381755%39, 47–74, 80–87
   sse_listener.py41880%50–55, 79–84
   trust_registry.py29390%24, 27–28
   webhooks.py45491%19, 74–77, 100
app/util
   acapy_issuer_utils.py18194%22
   acapy_verifier_utils.py137596%108–111, 189–192, 269
   credentials.py13377%11, 16, 19
   retry_method.py361558%20–35, 76–77, 91–103
   tenants.py451762%24–29, 44–45, 52–59, 90–91, 97, 124
endorser/services
   endorsement_processor.py137696%90, 152–162
webhooks/models
   conversions.py63690%70, 83, 89, 110, 145, 164
webhooks/services
   acapy_events_processor.py1862288%98, 161–171, 219–223, 251, 279–280, 308–312, 325–329, 354–367
   billing_manager.py175498%91, 98–99, 132
   sse_manager.py2353685%153, 155–168, 206–216, 245–246, 259–273, 328–332, 338–341, 343–346, 371–372, 415–417, 451, 462–463
   webhooks_redis_service.py1401986%70, 237–238, 354, 378–398, 411–422
webhooks/tests/services
   test_sse_manager.py180398%211–212, 218
webhooks/web/routers
   sse.py102397%168–171
TOTAL1298397193% 

Tests Skipped Failures Errors Time
855 8 💤 0 ❌ 0 🔥 12m 10s ⏱️

Copy link

github-actions bot commented May 2, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
app/routes
   connections.py603935%32–48, 64–76, 113–138, 159–173, 188–199
   definitions.py1889251%76–137, 170–171, 238–254, 269–275, 296–305, 328–329, 346–348, 391–445, 472–473, 517–597, 605–624
   issuer.py1733878%92, 128, 167–169, 198, 234–236, 244, 261, 360–370, 401–412, 445–476, 517, 530, 562
   jsonld.py604722%23–93, 104–137
   messaging.py241154%32–41, 61–71
   oob.py462839%27–68, 79–92, 116–127
   verifier.py1473378%64–66, 71, 109–111, 116, 158, 166–168, 173, 207–212, 218–220, 270–272, 278, 311–313, 318, 348–350, 384–386
   webhooks.py16475%32–36, 57–61
   websocket_endpoint.py23865%24–25, 37–42, 54–57, 70–76
app/routes/wallet
   credentials.py775232%32–45, 54–66, 75–86, 95–109, 120–136, 148–162, 171–183, 192–203
   dids.py762271%28–37, 56–57, 79–80, 92–99, 107–115
   jws.py422736%35–60, 76–99
   sd_jws.py422736%36–61, 78–101
app/services
   acapy_ledger.py611280%110–111, 124–140, 196–197
   acapy_wallet.py39490%60–61, 97–98
   revocation_registry.py1321291%317–321, 349, 359–361, 391–395, 420–425
   webhooks.py271833%17–25, 29–39
   websocket.py514120%19–22, 29–36, 47–91
app/services/event_handling
   websocket_manager.py732664%64–68, 87–90, 97–108, 115–125, 139
app/services/issuer
   acapy_issuer_v1.py921485%36, 76–110, 213–214
   acapy_issuer_v2.py1062279%60–63, 87–127, 173, 235–236, 263
app/services/onboarding
   tenants.py584424%30–97, 107–137
   verifier.py37392%67, 83–87
app/services/onboarding/util
   register_issuer_did.py86397%100–102
   set_endorser_metadata.py693746%28–30, 50–52, 76–78, 109–128, 140–149, 161–172, 185–197
app/services/trust_registry
   actors.py107992%94–99, 109, 208–209, 211–216, 281–284
   schemas.py49492%56–61, 91–96
app/services/trust_registry/util
   actor.py31294%26–27
   issuer.py23483%39–40, 48–49
app/tests/e2e
   conftest.py23578%43–51
   test_jsonld.py591673%133–168
   test_tenants.py3341596%167, 211–212, 240, 665, 699–700, 709–710, 719–720, 732–733, 742–743
   test_wallet_dids.py671085%92–107
app/tests/e2e/issuer
   test_save_exchange_record.py60198%142
app/tests/exception_handling
   test_handle_model_with_validation.py23196%22
app/tests/fixtures
   credentials.py57198%156
   definitions.py662661%29–50, 64–65, 94–124, 143–144
   member_acapy_clients.py36489%47–50, 73–74
   member_connections.py43881%80–91, 130–141
   member_wallets.py611575%29–34, 49–54, 69–74, 89–94, 111–118
app/tests/services
   test_revocation_registry.py135299%73, 106
app/tests/services/issuer
   test_issuer.py161299%316–319
app/tests/util
   connections.py852669%112–131, 140–157, 174–183, 238–260
   ledger.py491080%34, 42, 54, 62–66, 76, 82
   regression_testing.py381755%39, 47–74, 80–87
   sse_listener.py41880%50–55, 79–84
   trust_registry.py29390%24, 27–28
   webhooks.py45491%19, 74–77, 100
app/util
   acapy_issuer_utils.py18194%22
   acapy_verifier_utils.py137596%108–111, 189–192, 269
   credentials.py13377%11, 16, 19
   retry_method.py361558%20–35, 76–77, 91–103
   tenants.py451762%24–29, 44–45, 52–59, 90–91, 97, 124
endorser/services
   endorsement_processor.py137696%90, 152–162
webhooks/models
   conversions.py63690%70, 83, 89, 110, 145, 164
webhooks/services
   acapy_events_processor.py1862288%98, 161–171, 219–223, 251, 279–280, 308–312, 325–329, 354–367
   billing_manager.py175498%91, 98–99, 132
   sse_manager.py2353685%153, 155–168, 206–216, 245–246, 259–273, 328–332, 338–341, 343–346, 371–372, 415–417, 451, 462–463
   webhooks_redis_service.py1401986%70, 237–238, 354, 378–398, 411–422
webhooks/tests/services
   test_sse_manager.py180398%211–212, 218
webhooks/web/routers
   sse.py102397%168–171
TOTAL1300899792% 

Tests Skipped Failures Errors Time
855 8 💤 0 ❌ 0 🔥 14m 20s ⏱️

Copy link

github-actions bot commented May 6, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
app/routes
   connections.py603935%32–48, 64–76, 113–138, 159–173, 188–199
   definitions.py1889251%76–137, 170–171, 238–254, 269–275, 296–305, 328–329, 346–348, 391–445, 472–473, 517–597, 605–624
   issuer.py1733878%92, 128, 167–169, 198, 234–236, 244, 261, 360–370, 401–412, 445–476, 517, 530, 562
   jsonld.py604722%23–93, 104–137
   messaging.py241154%32–41, 61–71
   oob.py462839%27–68, 79–92, 116–127
   verifier.py1473378%64–66, 71, 109–111, 116, 158, 166–168, 173, 207–212, 218–220, 270–272, 278, 311–313, 318, 348–350, 384–386
   webhooks.py16475%32–36, 57–61
   websocket_endpoint.py23865%24–25, 37–42, 54–57, 70–76
app/routes/wallet
   credentials.py775232%32–45, 54–66, 75–86, 95–109, 120–136, 148–162, 171–183, 192–203
   dids.py762271%28–37, 56–57, 79–80, 92–99, 107–115
   jws.py422736%35–60, 76–99
   sd_jws.py422736%36–61, 78–101
app/services
   acapy_ledger.py611280%110–111, 124–140, 196–197
   acapy_wallet.py39490%60–61, 97–98
   revocation_registry.py1321291%317–321, 349, 359–361, 391–395, 420–425
   webhooks.py271833%17–25, 29–39
   websocket.py514120%19–22, 29–36, 47–91
app/services/event_handling
   websocket_manager.py732664%64–68, 87–90, 97–108, 115–125, 139
app/services/issuer
   acapy_issuer_v1.py921485%36, 76–110, 213–214
   acapy_issuer_v2.py1062279%60–63, 87–127, 173, 235–236, 263
app/services/onboarding
   tenants.py584424%30–97, 107–137
   verifier.py37392%67, 83–87
app/services/onboarding/util
   register_issuer_did.py86397%100–102
   set_endorser_metadata.py693746%28–30, 50–52, 76–78, 109–128, 140–149, 161–172, 185–197
app/services/trust_registry
   actors.py107992%94–99, 109, 208–209, 211–216, 281–284
   schemas.py49492%56–61, 91–96
app/services/trust_registry/util
   actor.py31294%26–27
   issuer.py23483%39–40, 48–49
app/tests/e2e
   conftest.py23578%43–51
   test_jsonld.py591673%134–169
   test_tenants.py3341596%167, 211–212, 240, 665, 699–700, 709–710, 719–720, 732–733, 742–743
   test_wallet_credentials.py30197%55
   test_wallet_dids.py671085%92–107
app/tests/e2e/issuer
   test_save_exchange_record.py71199%162
app/tests/exception_handling
   test_handle_model_with_validation.py23196%22
app/tests/fixtures
   credentials.py63198%169
   definitions.py662661%29–50, 64–65, 94–124, 143–144
   member_acapy_clients.py36489%47–50, 73–74
   member_connections.py43881%80–91, 130–141
   member_wallets.py611575%29–34, 49–54, 69–74, 89–94, 111–118
app/tests/services
   test_revocation_registry.py135299%73, 106
app/tests/services/issuer
   test_issuer.py161299%316–319
app/tests/util
   connections.py862769%114–139, 148–165, 182–191, 246–263
   ledger.py491080%34, 42, 54, 62–66, 76, 82
   regression_testing.py381755%39, 47–74, 80–87
   sse_listener.py41880%50–55, 79–84
   trust_registry.py29390%24, 27–28
   webhooks.py45491%19, 74–77, 100
app/util
   acapy_issuer_utils.py18194%22
   acapy_verifier_utils.py137596%108–111, 189–192, 269
   credentials.py13377%11, 16, 19
   retry_method.py361558%20–35, 76–77, 91–103
   tenants.py451762%24–29, 44–45, 52–59, 90–91, 97, 124
endorser/services
   endorsement_processor.py137696%90, 152–162
webhooks/models
   conversions.py63690%70, 83, 89, 110, 145, 164
webhooks/services
   acapy_events_processor.py1862288%98, 161–171, 219–223, 251, 279–280, 308–312, 325–329, 354–367
   billing_manager.py175498%91, 98–99, 132
   sse_manager.py2353685%153, 155–168, 206–216, 245–246, 259–273, 328–332, 338–341, 343–346, 371–372, 415–417, 451, 462–463
   webhooks_redis_service.py1401986%70, 237–238, 354, 378–398, 411–422
webhooks/tests/services
   test_sse_manager.py180398%211–212, 218
webhooks/web/routers
   sse.py102397%168–171
TOTAL1303799992% 

Tests Skipped Failures Errors Time
855 8 💤 0 ❌ 0 🔥 14m 9s ⏱️

Copy link

sonarqubecloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@ff137 ff137 changed the title 🧪 Feat/regression_tests 🧪 Initial regression testing framework May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
app/routes
   connections.py603935%32–48, 64–76, 113–138, 159–173, 188–199
   definitions.py1889251%76–137, 170–171, 238–254, 269–275, 296–305, 328–329, 346–348, 391–445, 472–473, 517–597, 605–624
   issuer.py1733878%92, 128, 167–169, 198, 234–236, 244, 261, 360–370, 401–412, 445–476, 517, 530, 562
   jsonld.py604722%23–93, 104–137
   messaging.py241154%32–41, 61–71
   oob.py462839%27–68, 79–92, 116–127
   verifier.py1473378%64–66, 71, 109–111, 116, 158, 166–168, 173, 207–212, 218–220, 270–272, 278, 311–313, 318, 348–350, 384–386
   webhooks.py16475%32–36, 57–61
   websocket_endpoint.py23865%24–25, 37–42, 54–57, 70–76
app/routes/wallet
   credentials.py775232%32–45, 54–66, 75–86, 95–109, 120–136, 148–162, 171–183, 192–203
   dids.py762271%28–37, 56–57, 79–80, 92–99, 107–115
   jws.py422736%35–60, 76–99
   sd_jws.py422736%36–61, 78–101
app/services
   acapy_ledger.py611280%110–111, 124–140, 196–197
   acapy_wallet.py39490%60–61, 97–98
   revocation_registry.py1321291%317–321, 349, 359–361, 391–395, 420–425
   webhooks.py271833%17–25, 29–39
   websocket.py514120%19–22, 29–36, 47–91
app/services/event_handling
   websocket_manager.py732664%64–68, 87–90, 97–108, 115–125, 139
app/services/issuer
   acapy_issuer_v1.py921485%36, 76–110, 213–214
   acapy_issuer_v2.py1062279%60–63, 87–127, 173, 235–236, 263
app/services/onboarding
   tenants.py584424%30–97, 107–137
   verifier.py37392%67, 83–87
app/services/onboarding/util
   register_issuer_did.py86397%100–102
   set_endorser_metadata.py693746%28–30, 50–52, 76–78, 109–128, 140–149, 161–172, 185–197
app/services/trust_registry
   actors.py107992%94–99, 109, 208–209, 211–216, 281–284
   schemas.py49492%56–61, 91–96
app/services/trust_registry/util
   actor.py31294%26–27
   issuer.py23483%39–40, 48–49
app/tests/e2e
   conftest.py23578%43–51
   test_jsonld.py591673%134–169
   test_tenants.py3341596%167, 211–212, 240, 665, 699–700, 709–710, 719–720, 732–733, 742–743
   test_wallet_credentials.py30197%55
   test_wallet_dids.py671085%92–107
app/tests/e2e/issuer
   test_save_exchange_record.py72199%166
app/tests/exception_handling
   test_handle_model_with_validation.py23196%22
app/tests/fixtures
   credentials.py65198%171
   definitions.py662661%29–50, 64–65, 94–124, 143–144
   member_acapy_clients.py36489%47–50, 73–74
   member_connections.py43881%80–91, 130–141
   member_wallets.py611575%29–34, 49–54, 69–74, 89–94, 111–118
app/tests/services
   test_revocation_registry.py135299%73, 106
app/tests/services/issuer
   test_issuer.py161299%316–319
app/tests/util
   connections.py862769%114–139, 148–165, 182–191, 246–263
   ledger.py491080%34, 42, 54, 62–66, 76, 82
   regression_testing.py381755%39, 47–74, 80–87
   sse_listener.py41880%50–55, 79–84
   trust_registry.py29197%24
   webhooks.py45491%19, 74–77, 100
app/util
   acapy_issuer_utils.py18194%22
   acapy_verifier_utils.py137596%108–111, 189–192, 269
   credentials.py13377%11, 16, 19
   retry_method.py361558%20–35, 76–77, 91–103
   tenants.py451762%24–29, 44–45, 52–59, 90–91, 97, 124
endorser/services
   endorsement_processor.py137696%90, 152–162
webhooks/models
   conversions.py63690%70, 83, 89, 110, 145, 164
webhooks/services
   acapy_events_processor.py1862288%98, 161–171, 219–223, 251, 279–280, 308–312, 325–329, 354–367
   billing_manager.py175498%91, 98–99, 132
   sse_manager.py2353685%153, 155–168, 206–216, 245–246, 259–273, 328–332, 338–341, 343–346, 371–372, 415–417, 451, 462–463
   webhooks_redis_service.py1401986%70, 237–238, 354, 378–398, 411–422
webhooks/tests/services
   test_sse_manager.py180398%211–212, 218
webhooks/web/routers
   sse.py102397%168–171
TOTAL1305999792% 

Tests Skipped Failures Errors Time
855 8 💤 0 ❌ 0 🔥 13m 51s ⏱️

@ff137 ff137 merged commit 75157b8 into development May 7, 2024
44 checks passed
@ff137 ff137 deleted the feat/regression_tests branch May 7, 2024 18:24
@ff137 ff137 mentioned this pull request May 9, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant