-
Notifications
You must be signed in to change notification settings - Fork 36
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
Cover nsmgr remote use-case via grpc unit tests #460
Cover nsmgr remote use-case via grpc unit tests #460
Conversation
Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>
Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>
Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package chainstest provides API for testing NSM chains such as Forwarder, NSC, NSMGR, NSE. |
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.
@edwarnicke , @haiodo Here I suggesting to add chainstest
pkg that has the next advantages:
- This pkg adds a possibility to test real nsmgr, nsc, nse, registries via grpc unit tests.
- This pkg simplifies the logic of creating, cleaning grpc servers/connection.
This can be super useful for testing the logic of interdomain/multi nodes chains and so on. For example for testing proxy-nsmgr we need to start these grpc servers:
1. forwarder1
2. forwarder2
3. nsmgr1
4. nsmgr2
5. nsc
6. nse
7. proxy-registry1
8. proxy-registyr2
9. proxy-nsmgr1
10. proxy-nsmgr2
11. registry
12. *floating registry
With this pkg we can hide the logic of creating these 12 servers that should simplify the testing.
Note: this pkg has a name convention with https://golang.org/pkg/net/http/httptest/
.
Please share your thoughts about this approach :)
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
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.
I'd like in general.
dialContext: b.dialContext, | ||
ctx: ctx, | ||
} | ||
b.resources = nil |
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.
Why?
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.
This is needed if the builder will be instantly used for creating the second NSM domain.
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>
…k@master networkservicemesh/sdk#460 networkservicemesh/sdk PR link: networkservicemesh/sdk#460 networkservicemesh/sdk commit message: commit 5b64906a352b8b04a60e5eaf386a4d59a4bbe58d Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com> Date: Wed Sep 16 15:33:09 2020 +0700 Cover nsmgr remote use-case via grpc unit tests (#460) * Add nsmgr local/remote grpc tests Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * fix linter issues Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * extract chaintest Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * add possible to pass custom context Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * apply review comments Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * self code review Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#460 networkservicemesh/sdk PR link: networkservicemesh/sdk#460 networkservicemesh/sdk commit message: commit 5b64906a352b8b04a60e5eaf386a4d59a4bbe58d Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com> Date: Wed Sep 16 15:33:09 2020 +0700 Cover nsmgr remote use-case via grpc unit tests (#460) * Add nsmgr local/remote grpc tests Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * fix linter issues Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * extract chaintest Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * add possible to pass custom context Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * apply review comments Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * self code review Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#460 networkservicemesh/sdk PR link: networkservicemesh/sdk#460 networkservicemesh/sdk commit message: commit 5b64906a352b8b04a60e5eaf386a4d59a4bbe58d Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com> Date: Wed Sep 16 15:33:09 2020 +0700 Cover nsmgr remote use-case via grpc unit tests (#460) * Add nsmgr local/remote grpc tests Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * fix linter issues Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * extract chaintest Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * add possible to pass custom context Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * apply review comments Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * self code review Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#460 networkservicemesh/sdk PR link: networkservicemesh/sdk#460 networkservicemesh/sdk commit message: commit 5b64906a352b8b04a60e5eaf386a4d59a4bbe58d Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com> Date: Wed Sep 16 15:33:09 2020 +0700 Cover nsmgr remote use-case via grpc unit tests (#460) * Add nsmgr local/remote grpc tests Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * fix linter issues Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * extract chaintest Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * add possible to pass custom context Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * apply review comments Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * self code review Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#460 networkservicemesh/sdk PR link: networkservicemesh/sdk#460 networkservicemesh/sdk commit message: commit 5b64906a352b8b04a60e5eaf386a4d59a4bbe58d Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com> Date: Wed Sep 16 15:33:09 2020 +0700 Cover nsmgr remote use-case via grpc unit tests (#460) * Add nsmgr local/remote grpc tests Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * fix linter issues Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * extract chaintest Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> * add possible to pass custom context Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * apply review comments Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com> * self code review Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Motivation