-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature/7.x/virtual connection #3908
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
Conversation
4fb2b02 to
f3f5280
Compare
|
Rebased, the idea behind spinning this off into its own project is To help testing, since many interfaces are gone mocking is not an option. This is by design we feel that you should mock the boundaries you control in your application (service layers/etc) injecting a connection that behaves a certain way can aid with testing though and E.g for elastic/apm-agent-dotnet#329 I want to use this to write unit test for the clients integration with APM. |
f3f5280 to
9038208
Compare
russcam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good, but I left some comments around naming and descriptions
|
|
||
| namespace Elasticsearch.Net.Virtual | ||
| { | ||
| public class VirtualizedCluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VirtualCluster, to align with VirtualConnection?
| <?xml version="1.0" encoding="utf-8"?> | ||
| <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
| <metadata> | ||
| <id>Elasticsearch.Net.Virtual</id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard 😃
Elasticsearch.Net.Virtual feels somewhat vague. The package is a way to mock/stub a cluster, with a specific IConnection implementation. Would Elasticsearch.Net.VirtualCluster, or Elasticsearch.Net.MockCluster or Elasticsearch.Net.StubCluster or Elasticsearch.Net.FakeCluster better convey the usage?
| <iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl> | ||
| <requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
| <summary>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</summary> | ||
| <description>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <description>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</description> | |
| <description>Provides a way to assert client behaviour through a rule engine backed VirtualClusterConnection</description> |
| <summary>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</summary> | ||
| <description>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</description> | ||
| <releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes> | ||
| <copyright>2014-$year$ Elasticsearch BV</copyright> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <copyright>2014-$year$ Elasticsearch BV</copyright> | |
| <copyright>2019-$year$ Elasticsearch BV</copyright> |
| <description>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</description> | ||
| <releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes> | ||
| <copyright>2014-$year$ Elasticsearch BV</copyright> | ||
| <tags>elasticsearch,elastic,search,lucene,nest</tags> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <tags>elasticsearch,elastic,search,lucene,nest</tags> | |
| <tags>elasticsearch,elastic,search,lucene,nest,tests,testing</tags> |
| <iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl> | ||
| <requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
| <summary>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</summary> | ||
| <description>Provides a way to assert cluent behaviour through a rule engine backed VirtualClusterConnection</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to also mention that it's useful for testing purposes?
Co-Authored-By: Russ Cam <russ.cam@elastic.co>
…lasticsearch-net into feature/7.x/virtual-connection
…r virtualized cluster project
* rename Serializer subfolder to Auxiliary * introduced seperate project for virtual cluster * VirtualCluster auditor returns a more real fake response * moved WaitingInMemoryConnection back * Union was copied twice * make sure VirtualClusterConnection is exposed * Add Elasticsearch.Net.Virtual as project into the build * do not rely on HttpClientException on net461 * Exception test needs to be .NET core specific now * build for canary was still looking in Serializers folder not Auxiliary * canary handling for Elasticsearch.Net.Virtual * skip nuget testing for Elasticearch.Net.Virtual * reference TestPackageVersion of Elasticsearch.Net optionally * still included csproj * Use targetting pack and made sure canary works under linux too * Update build/Elasticsearch.Net.Virtual.nuspec Co-Authored-By: Russ Cam <russ.cam@elastic.co> * Client on VirtualizedCluster became public on 7.x, mirror that here * change namespace to Elasticsearch.Net.VirtualizedCluster * update tests from 7.x and bumped sdk version * bump global json back * canary build needs to resolve Elasticsearch.Net reference as nuget for virtualized cluster project * bulk all exception tests canary ignore * bulk all exception tests canary ignore * make test less strict * skip test on CI (cherry picked from commit 25c0019)
* rename Serializer subfolder to Auxiliary * introduced seperate project for virtual cluster * VirtualCluster auditor returns a more real fake response * moved WaitingInMemoryConnection back * Union was copied twice * make sure VirtualClusterConnection is exposed * Add Elasticsearch.Net.Virtual as project into the build * do not rely on HttpClientException on net461 * Exception test needs to be .NET core specific now * build for canary was still looking in Serializers folder not Auxiliary * canary handling for Elasticsearch.Net.Virtual * skip nuget testing for Elasticearch.Net.Virtual * reference TestPackageVersion of Elasticsearch.Net optionally * still included csproj * Use targetting pack and made sure canary works under linux too * Update build/Elasticsearch.Net.Virtual.nuspec Co-Authored-By: Russ Cam <russ.cam@elastic.co> * Client on VirtualizedCluster became public on 7.x, mirror that here * change namespace to Elasticsearch.Net.VirtualizedCluster * update tests from 7.x and bumped sdk version * bump global json back * canary build needs to resolve Elasticsearch.Net reference as nuget for virtualized cluster project * bulk all exception tests canary ignore * bulk all exception tests canary ignore * make test less strict * skip test on CI
Moves our virtual clustering we use in tests into its own package.