Skip to content

feat: Register NpgsqlDataSource as a Keyed singleton #223

feat: Register NpgsqlDataSource as a Keyed singleton

feat: Register NpgsqlDataSource as a Keyed singleton #223

GitHub Actions / DotNET Tests succeeded Aug 23, 2024 in 0s

201 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
knightbus-azurestorage/tests/KnightBus.Azure.Storage.Tests.Integration/TestResults/test-results.trx 32✅ 19s
knightbus-azurestorage/tests/KnightBus.Azure.Storage.Tests.Unit/TestResults/test-results.trx 17✅ 10s
knightbus-nats/tests/KnightBus.Nats.Tests.Unit/TestResults/test-results.trx 5✅ 2s
knightbus-postgresql/tests/KnightBus.PostgreSql.Tests.Integration/TestResults/test-results.trx 39✅ 17s
knightbus-redis/tests/KnightBus.Redis.Tests.Integration/TestResults/test-results.trx 28✅ 11s
knightbus-redis/tests/KnightBus.Redis.Tests.Unit/TestResults/test-results.trx 2✅ 1s
knightbus-schedule/tests/KnightBus.Schedule.Tests.Unit/TestResults/test-results.trx 4✅ 883ms
knightbus/tests/KnightBus.Core.Tests.Unit/TestResults/test-results.trx 40✅ 2s
knightbus/tests/KnightBus.Host.Tests.Unit/TestResults/test-results.trx 34✅ 9s

✅ knightbus-azurestorage/tests/KnightBus.Azure.Storage.Tests.Integration/TestResults/test-results.trx

32 tests were completed in 19s with 32 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Azure.Storage.Tests.Integration.BlobLockManagerTests 5✅ 28s
KnightBus.Azure.Storage.Tests.Integration.BlobSagaStorageTests 15✅ 225ms
KnightBus.Azure.Storage.Tests.Integration.StorageQueueManagerTests 7✅ 548ms
KnightBus.Azure.Storage.Tests.Integration.StorageQueueMessagePumpTests 1✅ 22ms
KnightBus.Azure.Storage.Tests.Integration.StorageQueueMessageStateHandlerTests 4✅ 144ms

✅ KnightBus.Azure.Storage.Tests.Integration.BlobLockManagerTests

✅ Should_create_new_lock
✅ Should_not_get_lease_when_already_locked
✅ Should_not_renew_expired_lease
✅ Should_release_lease
✅ Should_renew_lease

✅ KnightBus.Azure.Storage.Tests.Integration.BlobSagaStorageTests

✅ Complete_should_delete_the_saga
✅ Complete_should_delete_the_saga_when_etag_matches
✅ Complete_should_throw_when_etag_differs
✅ Complete_should_throw_when_saga_not_found
✅ Delete_should_delete_the_saga
✅ Should_create_and_read_saga
✅ Should_not_throw_when_create_and_saga_expired
✅ Should_throw_when_create_and_saga_exists
✅ Should_throw_when_get_and_saga_does_not_exist
✅ Should_throw_when_get_and_saga_expired
✅ Update_should_change_to_current_etag_on_success
✅ Update_should_throw_when_etag_differs
✅ Update_should_throw_when_saga_not_found
✅ Update_should_update_the_saga
✅ Update_should_update_when_etag_match

✅ KnightBus.Azure.Storage.Tests.Integration.StorageQueueManagerTests

✅ Should_list_queues
✅ Should_move_dead_letter_message_to_original_queue
✅ Should_peek_dead_letter_message_without_deleting_it
✅ Should_peek_message_without_deleting_it
✅ Should_receive_dead_letter_message_and_delete_it
✅ Should_reflect_current_queue_properties
✅ Should_specify_queue_type

✅ KnightBus.Azure.Storage.Tests.Integration.StorageQueueMessagePumpTests

✅ PumpAsync_WhenQueuesDoesNotExist_ShouldCreateQueuesWithoutThrowing

✅ KnightBus.Azure.Storage.Tests.Integration.StorageQueueMessageStateHandlerTests

✅ Should_abandon_the_message_and_return_it_to_the_queue
✅ Should_complete_the_message_and_remove_it_from_the_queue
✅ Should_dead_letter_the_message_and_move_it_to_the_dl_queue
✅ Should_lock_the_message_and_make_it_invisible_when_processing

✅ knightbus-azurestorage/tests/KnightBus.Azure.Storage.Tests.Unit/TestResults/test-results.trx

17 tests were completed in 10s with 17 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Azure.Storage.Tests.Unit.ExtendMessageLockDurationMiddlewareTests 4✅ 7s
KnightBus.Azure.Storage.Tests.Unit.StorageQueueMessagePumpTests 9✅ 2s
KnightBus.Azure.Storage.Tests.Unit.StorageQueueReaderLocatorTests 3✅ 9ms
KnightBus.Azure.Storage.Tests.Unit.StorageQueueReaderStarterTests 1✅ 5ms

✅ KnightBus.Azure.Storage.Tests.Unit.ExtendMessageLockDurationMiddlewareTests

✅ Should_allow_regular_processing_settings_to_bypass_the_renewal
✅ Should_not_renew_after_completion
✅ Should_not_renew_lock_after_message_timeout
✅ Should_renew_lock

✅ KnightBus.Azure.Storage.Tests.Unit.StorageQueueMessagePumpTests

✅ Should_create_queue_when_it_doesnt_exists
✅ Should_not_create_queue_when_it_exists
✅ Should_not_exceed_max_concurrent_when_prefetch_is_high
✅ Should_not_fetch_more_messages_when_max_concurrent_is_reached
✅ Should_not_release_semaphore_until_task_is_completed
✅ Should_prefetch_messages
✅ Should_prefetch_one_message_when_set_to_zero
✅ Should_release_semaphore_if_exception
✅ Should_release_semaphore_when_message_lock_timeout_expires

✅ KnightBus.Azure.Storage.Tests.Unit.StorageQueueReaderLocatorTests

✅ Should_allow_creation_when_message_is_storage_message
✅ Should_create_instance
✅ Should_disallow_creation_when_message_is_not_storage_message

✅ KnightBus.Azure.Storage.Tests.Unit.StorageQueueReaderStarterTests

✅ Should_not_start_storage_queue_reader_with_too_high_prefetch_count

✅ knightbus-nats/tests/KnightBus.Nats.Tests.Unit/TestResults/test-results.trx

5 tests were completed in 2s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Nats.Tests.Unit.NatsBusTests 5✅ 161ms

✅ KnightBus.Nats.Tests.Unit.NatsBusTests

✅ When_publish_should_publish_message
✅ When_request_should_publish_message_and_receive
✅ When_request_stream_error_should_throw
✅ When_request_stream_should_recieve_all_messages
✅ When_send_should_publish_message

✅ knightbus-postgresql/tests/KnightBus.PostgreSql.Tests.Integration/TestResults/test-results.trx

39 tests were completed in 17s with 39 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.PostgreSql.Tests.Integration.PostgresBusTests 10✅ 6s
KnightBus.PostgreSql.Tests.Integration.PostgresMessageStateHandlerTests 4✅ 68ms
KnightBus.PostgreSql.Tests.Integration.PostgresQueueManagerTests 7✅ 217ms
KnightBus.PostgreSql.Tests.Integration.PostgresSagaStoreTests 10✅ 62ms
KnightBus.PostgreSql.Tests.Integration.PostgresSubscriptionManagerTests 7✅ 262ms
KnightBus.PostgreSql.Tests.Integration.PostgresTopicManagerTests 1✅ 9ms

✅ KnightBus.PostgreSql.Tests.Integration.PostgresBusTests

✅ AbandonByError
✅ Complete
✅ DeadLetterMessage
✅ GetMessages
✅ GetMessages_Empty
✅ GetMessages_visibility_timeout
✅ InsertMessages
✅ ManagementClient_SendMessages
✅ PeekDeadLetterMessagesAsync
✅ Schedule

✅ KnightBus.PostgreSql.Tests.Integration.PostgresMessageStateHandlerTests

✅ Should_abandon_the_message_and_return_it_to_the_queue
✅ Should_complete_the_message_and_remove_it_from_the_queue
✅ Should_dead_letter_the_message_and_move_it_to_the_dl_queue
✅ Should_lock_the_message_and_make_it_invisible_when_processing

✅ KnightBus.PostgreSql.Tests.Integration.PostgresQueueManagerTests

✅ Should_list_queues
✅ Should_move_dead_letter_message_to_original_queue
✅ Should_peek_dead_letter_message_without_deleting_it
✅ Should_peek_message_without_deleting_it
✅ Should_receive_dead_letter_message_and_delete_it
✅ Should_reflect_current_queue_properties
✅ Should_specify_queue_type

✅ KnightBus.PostgreSql.Tests.Integration.PostgresSagaStoreTests

✅ Complete_should_delete_the_saga
✅ Complete_should_throw_when_saga_not_found
✅ Delete_should_delete_the_saga
✅ Should_create_and_read_saga
✅ Should_not_throw_when_create_and_saga_expired
✅ Should_throw_when_create_and_saga_exists
✅ Should_throw_when_get_and_saga_does_not_exist
✅ Should_throw_when_get_and_saga_expired
✅ Update_should_throw_when_saga_not_found
✅ Update_should_update_the_saga

✅ KnightBus.PostgreSql.Tests.Integration.PostgresSubscriptionManagerTests

✅ Should_list_queues
✅ Should_move_dead_letter_message_to_original_queue
✅ Should_peek_dead_letter_message_without_deleting_it
✅ Should_peek_message_without_deleting_it
✅ Should_receive_dead_letter_message_and_delete_it
✅ Should_reflect_current_queue_properties
✅ Should_specify_queue_type

✅ KnightBus.PostgreSql.Tests.Integration.PostgresTopicManagerTests

✅ Should_list_subscription

✅ knightbus-redis/tests/KnightBus.Redis.Tests.Integration/TestResults/test-results.trx

28 tests were completed in 11s with 28 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Redis.Tests.Integration.RedisMessageStateHandlerTests 4✅ 317ms
KnightBus.Redis.Tests.Integration.RedisQueueClientTests 7✅ 264ms
KnightBus.Redis.Tests.Integration.RedisQueueManagerTests 7✅ 299ms
KnightBus.Redis.Tests.Integration.RedisSagaStoreTests 10✅ 69ms

✅ KnightBus.Redis.Tests.Integration.RedisMessageStateHandlerTests

✅ Should_abandon_the_message_and_return_it_to_the_queue
✅ Should_complete_the_message_and_remove_it_from_the_queue
✅ Should_dead_letter_the_message_and_move_it_to_the_dl_queue
✅ Should_lock_the_message_and_make_it_invisible_when_processing

✅ KnightBus.Redis.Tests.Integration.RedisQueueClientTests

✅ AbandonMessageByErrorAsync_should_requeue_message_and_set_error_hash
✅ CompleteMessageAsync_should_delete_hash_and_expiration_keys_then_remove_message
✅ DeadLetterMessageAsync_should_remove_from_processing_queue_and_put_message_in_deadletter_queue
✅ DeleteDeadletter_should_delete_deadletter_and_related_data
✅ GetDeadlettersAsync_should_return_deadletters
✅ GetMessagesAsync_should_get_messages
✅ RequeueDeadletterAsync_should_requeue_message_remove_errors_and_delivery_count

✅ KnightBus.Redis.Tests.Integration.RedisQueueManagerTests

✅ Should_list_queues
✅ Should_move_dead_letter_message_to_original_queue
✅ Should_peek_dead_letter_message_without_deleting_it
✅ Should_peek_message_without_deleting_it
✅ Should_receive_dead_letter_message_and_delete_it
✅ Should_reflect_current_queue_properties
✅ Should_specify_queue_type

✅ KnightBus.Redis.Tests.Integration.RedisSagaStoreTests

✅ Complete_should_delete_the_saga
✅ Complete_should_throw_when_saga_not_found
✅ Delete_should_delete_the_saga
✅ Should_create_and_read_saga
✅ Should_not_throw_when_create_and_saga_expired
✅ Should_throw_when_create_and_saga_exists
✅ Should_throw_when_get_and_saga_does_not_exist
✅ Should_throw_when_get_and_saga_expired
✅ Update_should_throw_when_saga_not_found
✅ Update_should_update_the_saga

✅ knightbus-redis/tests/KnightBus.Redis.Tests.Unit/TestResults/test-results.trx

2 tests were completed in 1s with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Redis.Tests.Unit.RedisQueueClientTests 2✅ 186ms

✅ KnightBus.Redis.Tests.Unit.RedisQueueClientTests

✅ GetMessagesAsync_should_not_try_to_fetch_messages_when_there_are_none
✅ GetMessagesAsync_should_return_available_messages_when_there_are_messages

✅ knightbus-schedule/tests/KnightBus.Schedule.Tests.Unit/TestResults/test-results.trx

4 tests were completed in 883ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Schedule.Tests.Unit.JobExecutorTests 4✅ 104ms

✅ KnightBus.Schedule.Tests.Unit.JobExecutorTests

✅ Should_execute_processor
✅ Should_not_execute_processor_when_no_lock
✅ Should_not_throw_on_lock_exceptions
✅ Should_not_throw_on_processor_exceptions

✅ knightbus/tests/KnightBus.Core.Tests.Unit/TestResults/test-results.trx

40 tests were completed in 2s with 40 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Core.Tests.Unit.AttachmentMiddlewareTests 3✅ 153ms
KnightBus.Core.Tests.Unit.AutoMessageMapperTests 3✅ 6ms
KnightBus.Core.Tests.Unit.DeadLetterMiddlewareTests 4✅ 30ms
KnightBus.Core.Tests.Unit.ErrorHandlingMiddlewareTests 4✅ 55ms
KnightBus.Core.Tests.Unit.JsonSerializerTests 4✅ 57ms
KnightBus.Core.Tests.Unit.MessageMapperTests 4✅ 2ms
KnightBus.Core.Tests.Unit.MessagePackSerializerTests 1✅ 98ms
KnightBus.Core.Tests.Unit.MicrosoftDependencyInjectionTests 3✅ 39ms
KnightBus.Core.Tests.Unit.ProtobufSerializerTests 1✅ 96ms
KnightBus.Core.Tests.Unit.SagaHandlerTests 3✅ 18ms
KnightBus.Core.Tests.Unit.SagaMapperTests 3✅ 2ms
KnightBus.Core.Tests.Unit.SagaMiddlewareTests 4✅ 28ms
KnightBus.Core.Tests.Unit.ThrottlingMiddlewareTests 3✅ 112ms

✅ KnightBus.Core.Tests.Unit.AttachmentMiddlewareTests

✅ Should_attach_attachment_when_command_have_attachment
✅ Should_delete_attachment_when_finished
✅ Should_not_attach_attachments_for_other_commands

✅ KnightBus.Core.Tests.Unit.AutoMessageMapperTests

✅ Should_find_registered_generic
✅ Should_find_registered_type
✅ Should_throw_for_non_registered_message

✅ KnightBus.Core.Tests.Unit.DeadLetterMiddlewareTests

✅ Should_call_BeforeDeadLetterAsync_before_dead_letter_messages
✅ Should_continue_when_not_dead_lettering
✅ Should_dead_letter_messages
✅ Should_not_continue_after_dead_letter_messages

✅ KnightBus.Core.Tests.Unit.ErrorHandlingMiddlewareTests

✅ Should_abandon_message_on_errors
✅ Should_catch_errors
✅ Should_log_errors
✅ Should_not_throw_when_abandon_message_on_errors_fails

✅ KnightBus.Core.Tests.Unit.JsonSerializerTests

✅ Newtonsoft_Should_not_serialize_attachments
✅ Newtonsoft_Should_serialize_deserialize_message
✅ Should_not_serialize_attachments
✅ Should_serialize_deserialize_message

✅ KnightBus.Core.Tests.Unit.MessageMapperTests

✅ Should_find_registered_mapping
✅ Should_find_registered_mapping_queue_name
✅ Should_map_assembly
✅ Should_throw_for_non_registered_message

✅ KnightBus.Core.Tests.Unit.MessagePackSerializerTests

✅ Should_serialize_deserialize_message

✅ KnightBus.Core.Tests.Unit.MicrosoftDependencyInjectionTests

✅ Dependency_injection_can_resolve_service_from_RegisterOpenGenericType
✅ DependencyInjection_can_register_open_generic
✅ DependencyInjection_resolves_services_in_correct_scope

✅ KnightBus.Core.Tests.Unit.ProtobufSerializerTests

✅ Should_serialize_deserialize_message

✅ KnightBus.Core.Tests.Unit.SagaHandlerTests

✅ Initialize_should_resume_saga_when_start_message_is_received
✅ Initialize_should_start_new_saga_when_start_message_is_received
✅ Initialize_should_throw_when_message_is_not_mapped

✅ KnightBus.Core.Tests.Unit.SagaMapperTests

✅ Should_map_message
✅ Should_map_start_message
✅ Should_throw_unmapped_message

✅ KnightBus.Core.Tests.Unit.SagaMiddlewareTests

✅ If_Saga_implements_ISagaDuplicateDetected_then_ProcessDuplicateAsync_should_be_called_and_should_complete_message_if_saga_already_is_started
✅ If_Saga_implements_ISagaDuplicateDetected_then_ProcessDuplicateAsync_throws_then_Exception_should_be_thrown
✅ Should_complete_message_if_saga_already_is_started
✅ Should_load_sagadata_and_call_next_when_success

✅ KnightBus.Core.Tests.Unit.ThrottlingMiddlewareTests

✅ Should_release_throttle_on_exception
✅ Should_release_throttle_when_cancellation_token_cancelled
✅ Should_throttle

✅ knightbus/tests/KnightBus.Host.Tests.Unit/TestResults/test-results.trx

34 tests were completed in 9s with 34 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
KnightBus.Host.Tests.Unit.MessageProcessing.Processors.MessageProcessorTests 3✅ 276ms
KnightBus.Host.Tests.Unit.MessageProcessing.Processors.RequestProcessorTests 5✅ 26ms
KnightBus.Host.Tests.Unit.MessageProcessing.Processors.StreamRequestProcessorTests 5✅ 32ms
KnightBus.Host.Tests.Unit.MessageProcessorLocatorTests 7✅ 167ms
KnightBus.Host.Tests.Unit.Middleware.MiddlewarePipelineTest 3✅ 30ms
KnightBus.Host.Tests.Unit.SingletonChannelReceiverTests 4✅ 6s
KnightBus.Host.Tests.Unit.StandardMessagePipelineTests 4✅ 45ms
KnightBus.Host.Tests.Unit.TcpAliveListenerPluginTests 1✅ 1s
KnightBus.Host.Tests.Unit.TransportStarterFactoryTests 2✅ 5ms

✅ KnightBus.Host.Tests.Unit.MessageProcessing.Processors.MessageProcessorTests

✅ Should_complete_successful_message
✅ Should_not_complete_failed_message
✅ Should_process_message

✅ KnightBus.Host.Tests.Unit.MessageProcessing.Processors.RequestProcessorTests

✅ Should_complete_successful_request
✅ Should_not_complete_failed_request
✅ Should_not_reply_failed_request
✅ Should_process_request
✅ Should_reply_successful_request

✅ KnightBus.Host.Tests.Unit.MessageProcessing.Processors.StreamRequestProcessorTests

✅ Should_complete_successful_request
✅ Should_not_complete_failed_request
✅ Should_not_reply_failed_request
✅ Should_process_request
✅ Should_reply_successful_request

✅ KnightBus.Host.Tests.Unit.MessageProcessorLocatorTests

✅ Should_locate_event_processors
✅ Should_locate_multiple_command_processors
✅ Should_locate_single__stream_request_processor
✅ Should_locate_single_command_processor
✅ Should_locate_single_request_processor
✅ Should_should_locate_singleton_processors
✅ Should_throw_when_message_transport_is_unknown

✅ KnightBus.Host.Tests.Unit.Middleware.MiddlewarePipelineTest

✅ Should_execute_ordered_pipeline_from_microsoft_di
✅ Should_execute_scoped_MessageProcessor_with_dependency_injection
✅ Should_move_message_scope_provider_right_after_error_middleware

✅ KnightBus.Host.Tests.Unit.SingletonChannelReceiverTests

✅ Should_only_start_one_queue_reader
✅ Should_override_singleton_impacted_settings
✅ Should_restart_queue_reader_when_lock_is_lost
✅ Should_start_new_queue_reader_when_lock_is_released

✅ KnightBus.Host.Tests.Unit.StandardMessagePipelineTests

✅ Should_abandon_message
✅ Should_deadletter_message
✅ Should_log_error
✅ Should_process_message

✅ KnightBus.Host.Tests.Unit.TcpAliveListenerPluginTests

✅ Should_RespondToPing

✅ KnightBus.Host.Tests.Unit.TransportStarterFactoryTests

✅ Should_use_custom_serializer
✅ Should_use_default_serializer