-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start two CNS servers with different handlers (#2650)
* start two cns servers * fix linter issues * fix linter issue * enhance echo server log * fix Quang's comments * gofumpt cns service.go * fix defaultAPIServerAddress * run servers asynchoronsly * add server_test.go * fix UT test * enhance log * fix log issue * fix an issue * add a check for defaultAPIServerURL * fix GetOption func * enhance comments * fix defaultAPI URL to 127.0.0.1 * fix restapi method in echo server * remove unnecessary log info * fix comment1 * fix comments * add context to control echo server * fix TM's comments * do not enable local server if user specifies cnsurl by -c option * add -p port check when getting nodeURL * fix comments and use -p select from customer to start local server * fix a case when customer does not provide -p option * fix the issue if customer also does not provide -p and -c option * add UTs to launch server with different combinations * fix linter issue for UTs * fix UT linter issues * UT needs to stop service * remove duplicated test case * comments fix * fix linter issue * fix Tim's comments * fix comments * fix linter issue * handle type assertion * Adding cnsURL and cnsPort options to test server The startService function is a mistake that has been perpetuated through time and needs to be removed. As a consequence of its existence, it requires mixing concerns in all tests and stands in the way of refactoring. The addition of two type assertion checks caused this function to break, because the corresponding options were not set in the Service's configuration. This is a problem in itself--there's no reason the options should be pulled out of a map[string]interface{}. Given this, we can just set these two options in startService, committing sins to offset the ones in service.(*HTTPRestService).Service.Options. --------- Signed-off-by: Paul Yu <129891899+paulyufan2@users.noreply.github.com> Co-authored-by: Tim Raymond <traymond@microsoft.com>
- Loading branch information
1 parent
654b1fa
commit be2dcc0
Showing
15 changed files
with
398 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.