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

Convert test code to use async #753

Open
wants to merge 1 commit into
base: dev-25.3
Choose a base branch
from

Conversation

YoshihitoAso
Copy link
Member

I have converted all test code to be asynchronous.

The following changes were made:

  • Updated pytest-asyncio to the latest version
  • Converted test code to use async

Note: Some parts still use psycopg, so I have not made any changes to the configuration yet.

@YoshihitoAso YoshihitoAso marked this pull request as ready for review February 8, 2025 16:53
@YoshihitoAso YoshihitoAso changed the title Make test code asynchronous Converted test code to use async Feb 8, 2025
@YoshihitoAso YoshihitoAso changed the title Converted test code to use async Convert test code to use async Feb 8, 2025
Copy link

github-actions bot commented Feb 8, 2025

Coverage

Coverage Report •
FileStmtsMissCoverMissing
tests
   conftest.py1290100% 
tests/app
   test_accounts_ChangeIssuerEOAPassword.py1050100% 
   test_accounts_ChangeIssuerRSAPassphrase.py1180100% 
   test_accounts_CreateChildAccount.py1440100% 
   test_accounts_CreateChildAccountInBatch.py1180100% 
   test_accounts_CreateIssuerKey.py880100% 
   test_accounts_CreateIssuerRSAKey.py1730100% 
   test_accounts_DeleteChildAccount.py420100% 
   test_accounts_DeleteIssuer.py290100% 
   test_accounts_DeleteIssuerAuthToken.py1400100% 
   test_accounts_GenerateIssuerAuthToken.py2150100% 
   test_accounts_ListAllChildAccount.py3040100% 
   test_accounts_ListAllIssuers.py400100% 
   test_accounts_RetrieveChildAccount.py550100% 
   test_accounts_RetrieveIssuer.py400100% 
   test_accounts_UpdateChildAccount.py750100% 
   test_blockchain_explorer_GetBlockData.py580100% 
   test_blockchain_explorer_GetTxData.py620100% 
   test_blockchain_explorer_ListBlockData.py1500100% 
   test_blockchain_explorer_ListTxData.py1270100% 
   test_bond_additional_issue_IssueAdditionalBond.py2590100% 
   test_bond_additional_issue_IssueAdditionalBondsInBatch.py3550100% 
   test_bond_additional_issue_ListAllBatchAdditionalBondIssue.py3540100% 
   test_bond_additional_issue_ListBondAdditionalIssuanceHistory.py1990100% 
   test_bond_additional_issue_RetrieveBatchAdditionalBondIssueStatus.py1740100% 
   test_bond_bulk_transfer_BulkTransferBondTokenOwnership.py2110100% 
   test_bond_bulk_transfer_ListBondTokenBulkTransfers.py1450100% 
   test_bond_bulk_transfer_RetrieveBondTokenBulkTransfer.py1890100% 
   test_bond_holders_CountBondTokenHolders.py2420100% 
   test_bond_holders_ListAllBondTokenHolders.py32750100% 
   test_bond_holders_RegisterBondTokenHolderExtraInfo.py2230100% 
   test_bond_holders_RetrieveBondTokenHolder.py2760100% 
   test_bond_lock_events_ListBondTokenLockUnlockEvents.py1910100% 
   test_bond_personal_info_InitiateBondTokenBatchPersonalInfoRegistration.py2750100% 
   test_bond_personal_info_ListAllBondTokenBatchPersonalInfoRegistration.py1730100% 
   test_bond_personal_info_RegisterBondTokenHolderPersonalInfo.py3940100% 
   test_bond_personal_info_RetrieveBondTokenPersonalInfoBatchRegistrationStatus.py620100% 
   test_bond_redeem_ListAllBatchBondRedemption.py3550100% 
   test_bond_redeem_ListBondRedemptionHistory.py1990100% 
   test_bond_redeem_RedeemBond.py2590100% 
   test_bond_redeem_RedeemBondsInBatch.py3550100% 
   test_bond_redeem_RetrieveBatchBondRedemptionStatus.py1740100% 
   test_bond_scheduled_events_DeleteScheduledBondTokenUpdateEvent.py950100% 
   test_bond_scheduled_events_ListAllScheduledBondTokenUpdateEvents.py720100% 
   test_bond_scheduled_events_RetrieveScheduledBondTokenUpdateEvent.py680100% 
   test_bond_scheduled_events_ScheduleBondTokenUpdateEvent.py2560100% 
   test_bond_scheduled_events_ScheduleBondTokenUpdateEventsInBatch.py2230100% 
   test_bond_tokens_IssueBondToken.py2930100% 
   test_bond_tokens_ListAllBondTokens.py3360100% 
   test_bond_tokens_ListBondOperationLogHistory.py4070100% 
   test_bond_tokens_RetrieveBondToken.py1230100% 
   test_bond_tokens_UpdateBondToken.py4980100% 
   test_bond_transfer_approvals_ListAllBondTokenTransferApprovalHistory.py5830100% 
   test_bond_transfer_approvals_ListSpecificBondTokenTransferApprovalHistory.py11120100% 
   test_bond_transfer_approvals_RetrieveBondTokenTransferApprovalStatus.py3940100% 
   test_bond_transfer_approvals_UpdateBondTokenTransferApprovalStatus.py9750100% 
   test_bond_transfers_ListBondTokenTransferHistory.py9190100% 
   test_bond_transfers_TransferBondTokenOwnership.py2390100% 
   test_common_GetE2EEncryptionKey.py80100% 
   test_common_GetLatestBlockNumber.py170100% 
   test_common_ServiceHealthCheck.py470100% 
   test_docs_GET.py100100% 
   test_e2e_messaging_ChangeE2EMessagingAccountEOAPassword.py940100% 
   test_e2e_messaging_ChangeE2EMessagingAccountRSAPassphrase.py1550100% 
   test_e2e_messaging_CreateE2EMessagingAccount.py1450100% 
   test_e2e_messaging_DeleteE2EMessagingAccount.py450100% 
   test_e2e_messaging_ListAllE2EMessages.py1160100% 
   test_e2e_messaging_ListAllE2EMessagingAccounts.py810100% 
   test_e2e_messaging_RetrieveE2EMessage.py630100% 
   test_e2e_messaging_RetrieveE2EMessagingAccount.py500100% 
   test_e2e_messaging_UpdateE2EMessagingAccountRSAKey.py920100% 
   test_file_DeleteFile.py550100% 
   test_file_DownloadFile.py870100% 
   test_file_ListAllUploadFiles.py3160100% 
   test_file_UploadFile.py860100% 
   test_freezelog_ChangeFreezeLogAccountPassword.py680100% 
   test_freezelog_CreateFreezeLogAccount.py590100% 
   test_freezelog_DeleteFreezeLogAccount.py250100% 
   test_freezelog_ListAllFreezeLogAccount.py250100% 
   test_freezelog_RecordNewFreezeLog.py1410100% 
   test_freezelog_RetriveFreezeLog.py700100% 
   test_freezelog_UpdateFreezeLog.py1430100% 
   test_ledger_CreateLedgerDetailsData.py1240100% 
   test_ledger_CreateUpdateLedgerTemplate.py2010100% 
   test_ledger_DeleteLedgerDetailsData.py1010100% 
   test_ledger_DeleteLedgerTemplate.py1050100% 
   test_ledger_ListAllLedgerDetailsData.py2220100% 
   test_ledger_ListAllLedgerHistory.py1520100% 
   test_ledger_RetrieveLedgerDetailsData.py2010100% 
   test_ledger_RetrieveLedgerHistory.py5210100% 
   test_ledger_RetrieveLedgerTemplate.py1820100% 
   test_ledger_UpdateLedgerDetailsData.py1540100% 
   test_notifications_DeleteNotification.py960100% 
   test_notifications_ListAllNotifications.py2080100% 
   test_positions_ForceUnlock.py2880100% 
   test_positions_ListAccountLockUnlockEvents.py7300100% 
   test_positions_ListAllLockedPosition.py3410100% 
   test_positions_ListAllPositions.py7220100% 
   test_positions_RetrieveTokenPositionForAccount.py3290100% 
   test_sealed_tx_SealedTxRegisterHolderExtraInfo.py670100% 
   test_sealed_tx_SealedTxRegisterPersonalInfo.py850100% 
   test_settlement_agent_ChangeDVPAgentAccountPassword.py680100% 
   test_settlement_agent_CreateDVPAgentAccount.py550100% 
   test_settlement_agent_DeleteDVPAgentAccount.py250100% 
   test_settlement_agent_ListAllDVPAgentAccounts.py250100% 
   test_settlement_agent_ListAllDVPAgentDeliveries.py14160100% 
   test_settlement_agent_UpdateDVPAgentDelivery.py1900100% 
   test_settlement_issuer_CreateDVPDelivery.py3130100% 
   test_settlement_issuer_ListAllDVPDeliveries.py17360100% 
   test_settlement_issuer_RetrieveDVPDelivery.py1170100% 
   test_settlement_issuer_UpdateDVPDelivery.py2090100% 
   test_share_additional_issue_IssueAdditionalShare.py2230100% 
   test_share_additional_issue_IssueAdditionalSharesInBatch.py3550100% 
   test_share_additional_issue_ListAllBatchAdditionalShareIssue.py3550100% 
   test_share_additional_issue_ListShareAdditionalIssuanceHistory.py1990100% 
   test_share_additional_issue_RetrieveBatchAdditionalShareIssueStatus.py1740100% 
   test_share_bulk_transfer_BulkTransferShareTokenOwnership.py2200100% 
   test_share_bulk_transfer_ListShareTokenBulkTransfers.py1450100% 
   test_share_bulk_transfer_RetrieveShareTokenBulkTransfer.py1890100% 
   test_share_holders_CountShareTokenHolders.py2420100% 
   test_share_holders_ListAllShareTokenHolders.py32810100% 
   test_share_holders_RegisterShareTokenHolderExtraInfo.py2230100% 
   test_share_holders_RetrieveShareTokenHolder.py2760100% 
   test_share_lock_events_ListShareTokenLockUnlockEvents.py1910100% 
   test_share_personal_info_InitiateShareTokenBatchPersonalInfoRegistration.py2740100% 
   test_share_personal_info_ListAllShareTokenBatchPersonalInfoRegistration.py1730100% 
   test_share_personal_info_RegisterShareTokenHolderPersonalInfo.py3940100% 
   test_share_personal_info_RetrieveShareTokenPersonalInfoBatchRegistrationStatus.py620100% 
   test_share_redeem_ListAllBatchShareRedemption.py3550100% 
   test_share_redeem_ListShareRedemptionHistory.py1990100% 
   test_share_redeem_RedeemShare.py2230100% 
   test_share_redeem_RedeemSharesInBatch.py3550100% 
   test_share_redeem_RetrieveBatchShareRedemptionStatus.py1740100% 
   test_share_scheduled_events_DeleteScheduledShareTokenUpdateEvent.py940100% 
   test_share_scheduled_events_ListAllScheduledShareTokenUpdateEvents.py720100% 
   test_share_scheduled_events_RetrieveScheduledShareTokenUpdateEvent.py680100% 
   test_share_scheduled_events_ScheduleShareTokenUpdateEvent.py2280100% 
   test_share_scheduled_events_ScheduleShareTokenUpdateEventsInBatch.py1960100% 
   test_share_tokens_IssueShareToken.py3910100% 
   test_share_tokens_ListAllShareTokens.py2970100% 
   test_share_tokens_ListShareOperationLogHistory.py3940100% 
   test_share_tokens_RetrieveShareToken.py1110100% 
   test_share_tokens_UpdateShareToken.py4270100% 
   test_share_transfer_approvals_ListAllBondTokenTransferApprovalHistory.py5780100% 
   test_share_transfer_approvals_ListSpecificShareTokenTransferApprovalHistory.py11120100% 
   test_share_transfer_approvals_RetrieveShareTokenTransferApprovalStatus.py3940100% 
   test_share_transfer_approvals_UpdateShareTokenTransferApprovalStatus.py9740100% 
   test_share_transfers_ListShareTokenTransferHistory.py9190100% 
   test_share_transfers_TransferShareTokenOwnership.py2480100% 
   test_token_common_ListAllIssuedTokens.py2750100% 
   test_token_holders_CreateTokenHoldersCollection.py2230100% 
   test_token_holders_ListAllTokenHoldersCollections.py3290100% 
   test_token_holders_ListTokenHoldersPersonalInfo.py3720100% 
   test_token_holders_ListTokenHoldersPersonalInfoHistory.py2800100% 
   test_token_holders_RetrieveTokenHoldersCollection.py6680100% 
tests/app/model/blockchain
   test_E2EMessaging.py2090100% 
   test_FreezeLog.py1150100% 
   test_PersonalInfo.py2650100% 
   test_TokenList.py990100% 
   test_exchange_IbetExchangeInterface.py630100% 
   test_exchange_IbetSecurityTokenEscrow.py1260100% 
   test_token_IbetShare.py15720100% 
   test_token_IbetStraightBond.py15970100% 
tests/app/utils
   test_asynccontract_utils.py1960100% 
   test_check_utils.py1580100% 
   test_contract_utils.py1500100% 
   test_sealed_tx_utils.py670100% 
tests/batch
   test_indexer_block_tx_data.py149298%297, 330
   test_indexer_dvp_delivery.py11980100% 
   test_indexer_e2e_messaging.py7480100% 
   test_indexer_issue_redeem.py3950100% 
   test_indexer_personal_info.py5300100% 
   test_indexer_position_bond.py23010100% 
   test_indexer_position_share.py23120100% 
   test_indexer_token_cache.py162596%385, 388, 391, 398–399
   test_indexer_token_holders.py7081398%63–69, 84–86, 88, 91, 94
   test_indexer_transfer.py6570100% 
   test_indexer_transfer_approval.py7800100% 
   test_processor_batch_create_child_account.py1060100% 
   test_processor_batch_issue_redeem.py5470100% 
   test_processor_batch_issue_redeem_v2406.py4550100% 
   test_processor_bulk_transfer.py6500100% 
   test_processor_create_ledger.py1420100% 
   test_processor_create_utxo.py8880100% 
   test_processor_dvp_async_tx.py7030100% 
   test_processor_generate_rsa_key.py1200100% 
   test_processor_modify_personal_info.py2290100% 
   test_processor_monitor_block_sync.py1373772%132, 136–139, 142, 145, 215, 219, 221–225, 227–231, 247–248, 252, 254–258, 260–264, 266–270
   test_processor_register_personal_info.py4270100% 
   test_processor_rotate_e2e_messaging_rsa_key.py3020100% 
   test_processor_scheduled_events.py3690100% 
   test_processor_update_token.py5480100% 
TOTAL80566417394% 

Tests Skipped Failures Errors Time
2043 0 💤 0 ❌ 0 🔥 18m 19s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant