Skip to content

Commit

Permalink
e2e: plumb http server flags
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Zelinskie <jimmy@zelinskie.com>
  • Loading branch information
jzelinskie committed Oct 22, 2021
1 parent 0cccd8d commit 2515fc2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions e2e/newenemy/newenemy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestNoNewEnemy(t *testing.T) {
protectedSpiceDb := spice.NewClusterFromCockroachCluster(crdb,
spice.WithGrpcPort(50061),
spice.WithInternalPort(50062),
spice.WithHttpPort(8444),
spice.WithMetricsPort(9100),
spice.WithDashboardPort(8100),
spice.WithDbName(dbName))
Expand Down
7 changes: 7 additions & 0 deletions e2e/spice/spicedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Node struct {
DbName string
URI string
GrpcPort int
HttpPort int
InternalPort int
MetricsPort int
DashboardPort int
Expand All @@ -46,6 +47,9 @@ func WithTestDefaults(opts ...SpiceDbOption) SpiceDbOption {
if s.InternalPort == 0 {
s.InternalPort = 50052
}
if s.HttpPort == 0 {
s.HttpPort = 443
}
if s.MetricsPort == 0 {
s.MetricsPort = 9090
}
Expand Down Expand Up @@ -74,9 +78,11 @@ func (s *Node) Start(ctx context.Context, logprefix string, args ...string) erro
"--log-level=debug",
"--grpc-preshared-key=" + s.PresharedKey,
"--grpc-no-tls",
"--http-no-tls",
"--datastore-engine=" + s.Datastore,
"--datastore-conn-uri=" + s.URI,
fmt.Sprintf("--grpc-addr=:%d", s.GrpcPort),
fmt.Sprintf("--http-addr=:%d", s.HttpPort),
fmt.Sprintf("--internal-grpc-addr=:%d", s.InternalPort),
fmt.Sprintf("--metrics-addr=:%d", s.MetricsPort),
fmt.Sprintf("--dashboard-addr=:%d", s.DashboardPort),
Expand Down Expand Up @@ -142,6 +148,7 @@ func NewClusterFromCockroachCluster(c cockroach.Cluster, opts ...SpiceDbOption)
URI: c[i].ConnectionString(proto.DbName),
GrpcPort: proto.GrpcPort + 2*i,
InternalPort: proto.InternalPort + 2*i,
HttpPort: proto.HttpPort + 2*i,
MetricsPort: proto.MetricsPort + i,
DashboardPort: proto.DashboardPort + i,
})
Expand Down
7 changes: 7 additions & 0 deletions e2e/spice/spicedb_options.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2515fc2

Please sign in to comment.