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

Add Integration tests for NServiceBus 6/7 #852

Merged
merged 17 commits into from
Dec 15, 2021

Conversation

JcolemanNR
Copy link
Contributor

@JcolemanNR JcolemanNR commented Dec 14, 2021

Description

Resolves #821

This adds Integration tests for the new NSB 6/7 feature. The Send and Publish api's are tested, as well as handling send/publish in both sync/async forms. The Error handling tests currently fail because a call to NoticeError does not happen in the NSB 6/7 wrapper like the NSB 5 wrapper. I left this failing. Also, the event/command handler tests currently pass, but are expecting the generic 'temp' queue name. The expected strings should be changed when a fix is in place for accessing the queue name.

Our NSB 5 tests use MSMQ, which prevented them from being run on linux, but these new tests make use of the LearningTransport that was introduced in NSB 6. This uses the local filesystem to simulate a real transport. I had to use some overly basic namespaces/typenames for the new test classes since the paths/filenames that were being generated by the learning transport exceeded OS limits.

The tests currently err on the side of thoroughly covering all supported execution platforms (framework/core versions), which can be scaled back if desired.

@JcolemanNR JcolemanNR linked an issue Dec 14, 2021 that may be closed by this pull request
@@ -53,6 +53,15 @@
<PackageReference Include="RabbitMQ.Client" Version="6.2.1" Condition="'$(TargetFramework)' == 'net5.0'" />
<PackageReference Include="RabbitMQ.Client" Version="6.2.1" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="NServiceBus" Version="5.0.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="NServiceBus" Version="6.5.10" Condition="'$(TargetFramework)' == 'net471'" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.NET framework 4.7.1 tests supported version of NServiceBus 6

}

[NetCoreTest]
public class NServiceBusThrowingCommandHandlerTestsCoreLatest : NServiceBusThrowingCommandHandlerTestsBase<ConsoleDynamicMethodFixtureCoreLatest>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking by targeting .NET Core latest and 6.0 is that it somewhat future proofs this when the fixtures get updated?

Copy link
Member

@jaffinito jaffinito left a comment

Choose a reason for hiding this comment

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

I didn't comment on all the explain plan entries, but they should be removed since it is not going to do anything.

Otherwise, this looks great.

@JcolemanNR JcolemanNR merged commit d6aabbf into nservicebus7-feature-branch Dec 15, 2021
@JcolemanNR JcolemanNR deleted the jcoleman/nsb7-int-tests branch December 15, 2021 18:58
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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add integration test coverage for NSB 6 and 7
2 participants