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 namespace file with build tag for OSS tests #16590

Merged
merged 4 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ func TestAPIGatewayCreate(t *testing.T) {
// Create a client proxy instance with the server as an upstream
_, gatewayService := createServices(t, cluster, listenerPortOne)

//make sure the gateway/route come online
//make sure config entries have been properly created
checkGatewayConfigEntry(t, client, "api-gateway", "")
checkTCPRouteConfigEntry(t, client, "api-gateway-route", "")
// make sure the gateway/route come online
// make sure config entries have been properly created
namespace := getNamespace()
checkGatewayConfigEntry(t, client, "api-gateway", namespace)
checkTCPRouteConfigEntry(t, client, "api-gateway-route", namespace)

port, err := gatewayService.GetPort(listenerPortOne)
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ import (
"crypto/rand"
"encoding/hex"
"fmt"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/hashicorp/consul/api"
libassert "github.com/hashicorp/consul/test/integration/consul-container/libs/assert"
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
libservice "github.com/hashicorp/consul/test/integration/consul-container/libs/service"
libtopology "github.com/hashicorp/consul/test/integration/consul-container/libs/topology"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"time"
)

func getNamespace() string {
return ""
}

// randomName generates a random name of n length with the provided
// prefix. If prefix is omitted, the then entire name is random char.
func randomName(prefix string, n int) string {
Expand Down Expand Up @@ -80,7 +78,6 @@ func TestHTTPRouteFlattening(t *testing.T) {
},
)

//TODO this should only matter in consul enterprise I believe?
namespace := getNamespace()
gatewayName := randomName("gw", 16)
routeOneName := randomName("route", 16)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build !consulent
// +build !consulent

package gateways

func getNamespace() string {
return ""
}