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

Migrates NServiceBus 5 tests to use ConsoleMF app #833

Merged
merged 4 commits into from
Dec 6, 2021

Conversation

jaffinito
Copy link
Member

@jaffinito jaffinito commented Dec 3, 2021

Description

Migrates existing NServiceBus apps, class, and libraries to use the ConsoleMF framework app.

  • Removes projects: NServiceBusReceiver, NServiceBusReceiverHost, NServiceBusBasicMvcApplication
  • Removes fixtures: NServiceBusBasicMvcApplicationFixture and NServiceBusReceiverFixture

New NServiceBus5 libraries in MultiFunctionApplicationHelpers handle everything for NSB now.

  • NSB 5 is only available in net462. NSB5 is not supported but Particular anymore and so this limitation allows new versions to make use of the new framework versions for testing. Class have been placed behind preprocessor directives.
  • Added a setup method to ensure everything is in place before running tests
  • Only the default Send command is manually instrumented as a transaction since the receive side will create one for us.

Add a RootCommands Library that current only has a DelaySeconds command used to allow messages to arrive without using AgentLog specific delays (might want revisit later)

Testing the Send/Receive using consoleMF outside of the test suite
Start the ConsoleMF app for framework

Send:
NServiceBusSetup Setup
NServiceBusService Start
NServiceBusService Send

Result:
"Message with ID={message.Id} sent via NServiceBus"


Send/Receive
NServiceBusSetup Setup
NServiceBusService Start
NServiceBusReceiverHost Start
NServiceBusService SendValid
NServiceBusService SendInvalid

Result:
Message with ID={message.Id} sent via NServiceBus
Message with ID={message.Id} sent via NServiceBus
Received Valid message with contents={message.FooBar}
Received Invalid message with contents={message.FooBar}
Message was invalid, throwing an exception!
An exception was thrown inside the NServiceBus Receive Handler!!!!

Author Checklist

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)
  • Review Changelog

resolves #820

@jaffinito jaffinito added the enhancement New feature or request label Dec 3, 2021
@jaffinito jaffinito linked an issue Dec 4, 2021 that may be closed by this pull request
@JcolemanNR JcolemanNR changed the title MIgrates NServiceBus 5 tests to use ConsoleMF app Migrates NServiceBus 5 tests to use ConsoleMF app Dec 6, 2021
Copy link
Contributor

@JcolemanNR JcolemanNR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jaffinito jaffinito merged commit c579261 into nservicebus7-feature-branch Dec 6, 2021
@jaffinito jaffinito deleted the nsb5-consoleMF branch December 6, 2021 21:36
jaffinito added a commit that referenced this pull request Dec 17, 2021
* Adds NServiceBus 6/7 message receive instrumentation. (#830)

* Adds NServiceBus 6/7 message receive instrumentation.

* Update ReceiveMessageWrapper.cs

Removes comment which resulted from copy/paste.

* Trigger CI checks on nservicebus7-feature-branch PRs

* Adds PipelineWrapper for message send/publish instrumentation. (#832)

* Migrates NServiceBus 5 tests to use ConsoleMF app (#833)

* Working NSB5 app in ConsoleMF
* Working NServiceBus5Tests
* Working Send and Receive tests
* Remove old NServiceBus files

* Adds NServiceBus to CoreComponents in ArtifactBuilder (#851)

* Add Integration tests for NServiceBus 6/7 (#852)

* NSB 6/7+ Integration tests

* Update to avoid compiling in 4.6.2

* Fix NSB 5 tests, run in CI

* More tests

* Investigate 'Temp' queue name... add debugger launch

* Add remaining tests, Currently the consume naming is hardcoded to the 'temp' queue to pass. The ThrowingCommandHandler tests also fail because 'error_data' is not being reported

* Remove unwanted test that snuck in

* Remove commented copy/paste spam

* Remove change from when the streams got crossed

* Formatting, fix timeout for one fixture

* Cleanup, and reduce length of type names to allow learning transport to work properly for all tests (The throwing handler FW tests weren't working)

* Update test expectations after shortening namespaces

* CR Feedback: Remove explain plan configuration modifications

* Fix issue with bypasser (#856)

- Split out the various calls to the VisibiltyBypasser from the NSB wrappers into their own functions
- Updated tests to account for names now appearing
- Added support for noticing errors from the LoadHandlersConnectorWrapper with test
- Minor formatting and naming changes

* Merge main and update changelog

* NSB: Fix issue with Handler transactions being ended by GC (#858)

* New and improved LoadHandlersConnector Wrapper

* Verify we aren't abandoning any transactions

Co-authored-by: Vu Tran <56414817+vuqtran88@users.noreply.github.com>
Co-authored-by: Josh Coleman <83677148+JcolemanNR@users.noreply.github.com>
Co-authored-by: Josh Coleman <jcoleman@newrelic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate existing NServiceBus 5 tests to ConsoleMF
2 participants