Skip to content

Commit

Permalink
Move baz tests out of example dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuntao Lu committed Apr 21, 2017
1 parent cc44d04 commit 90cb31a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
14 changes: 0 additions & 14 deletions examples/example-gateway/endpoints/baz/baz_structs.go

This file was deleted.

34 changes: 34 additions & 0 deletions test/endpoints/baz/baz_helper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// TODO: (lu) to be generated

package baz

import (
"runtime"

"github.com/uber/zanzibar/runtime"
)

func getDirName() string {
_, file, _, _ := runtime.Caller(0)
return zanzibar.GetDirnameFromRuntimeCaller(file)
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func TestCallSuccessfulRequestOKResponse(t *testing.T) {
}, &testGateway.Options{
KnownTChannelBackends: []string{"baz"},
TestBinary: filepath.Join(
getDirName(), "..", "..", "build", "main.go",
getDirName(), "..", "..", "..",
"examples", "example-gateway", "build", "main.go",
),
})
if !assert.NoError(t, err, "got bootstrap err") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func TestCompareSuccessfulRequestOKResponse(t *testing.T) {
}, &testGateway.Options{
KnownTChannelBackends: []string{"baz"},
TestBinary: filepath.Join(
getDirName(), "..", "..", "build", "main.go",
getDirName(), "..", "..", "..",
"examples", "example-gateway", "build", "main.go",
),
})
if !assert.NoError(t, err, "got bootstrap err") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func TestPingSuccessfulRequestOKResponse(t *testing.T) {
}, &testGateway.Options{
KnownTChannelBackends: []string{"baz"},
TestBinary: filepath.Join(
getDirName(), "..", "..", "build", "main.go",
getDirName(), "..", "..", "..",
"examples", "example-gateway", "build", "main.go",
),
})
if !assert.NoError(t, err, "got bootstrap err") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func TestSillyNoopFutureSuccessfulRequestOKResponse(t *testing.T) {
}, &testGateway.Options{
KnownTChannelBackends: []string{"baz"},
TestBinary: filepath.Join(
getDirName(), "..", "..", "build", "main.go",
getDirName(), "..", "..", "..",
"examples", "example-gateway", "build", "main.go",
),
})
if !assert.NoError(t, err, "got bootstrap err") {
Expand Down

0 comments on commit 90cb31a

Please sign in to comment.