Skip to content

Commit

Permalink
rm unneeded prints rm raft_test.sh, rm tag flag, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbajoe committed Apr 21, 2024
1 parent f7d9f50 commit b631b26
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 65 deletions.
3 changes: 0 additions & 3 deletions cmd/dgate-cli/commands/collection.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package commands

import (
"fmt"

"github.com/dgate-io/dgate/pkg/dgclient"
"github.com/dgate-io/dgate/pkg/spec"
"github.com/urfave/cli/v2"
Expand All @@ -27,7 +25,6 @@ func CollectionCommand(client *dgclient.DGateClient) *cli.Command {
if err != nil {
return err
}
fmt.Println(col, client.BaseUrl())
err = client.CreateCollection(col)
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/dgate-cli/commands/document.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package commands

import (
"fmt"

"github.com/dgate-io/dgate/pkg/dgclient"
"github.com/dgate-io/dgate/pkg/spec"
"github.com/urfave/cli/v2"
Expand All @@ -28,7 +26,6 @@ func DocumentCommand(client *dgclient.DGateClient) *cli.Command {
if err != nil {
return err
}
fmt.Println(doc, client.BaseUrl())
err = client.CreateDocument(doc)
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/dgate-cli/commands/module.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package commands

import (
"fmt"

"github.com/dgate-io/dgate/pkg/dgclient"
"github.com/dgate-io/dgate/pkg/spec"
"github.com/urfave/cli/v2"
Expand All @@ -27,7 +25,6 @@ func ModuleCommand(client *dgclient.DGateClient) *cli.Command {
if err != nil {
return err
}
fmt.Println(mod, client.BaseUrl())
err = client.CreateModule(mod)
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/dgate-cli/commands/namespace.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package commands

import (
"fmt"

"github.com/dgate-io/dgate/pkg/dgclient"
"github.com/dgate-io/dgate/pkg/spec"
"github.com/urfave/cli/v2"
Expand All @@ -25,7 +23,6 @@ func NamespaceCommand(client *dgclient.DGateClient) *cli.Command {
if err != nil {
return err
}
fmt.Println(ns, client.BaseUrl())
err = client.CreateNamespace(ns)
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/dgate-cli/commands/route.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package commands

import (
"fmt"

"github.com/dgate-io/dgate/pkg/dgclient"
"github.com/dgate-io/dgate/pkg/spec"
"github.com/urfave/cli/v2"
Expand All @@ -28,7 +26,6 @@ func RouteCommand(client *dgclient.DGateClient) *cli.Command {
if err != nil {
return err
}
fmt.Println(rt, client.BaseUrl())
err = client.CreateRoute(rt)
if err != nil {
return err
Expand Down
15 changes: 1 addition & 14 deletions cmd/dgate-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,7 @@ func main() {
Name: "auth",
Aliases: []string{"a"},
EnvVars: []string{"DGATE_ADMIN_AUTH"},
Usage: "the authorization credentials or token",
},
// &cli.StringFlag{
// Name: "auth-scheme",
// Value: "Basic",
// Aliases: []string{"A"},
// EnvVars: []string{"DGATE_ADMIN_AUTH_SCHEME"},
// Usage: "the authorization scheme",
// },
&cli.StringFlag{
Name: "tag",
Aliases: []string{"t"},
Value: "default",
Usage: "the namespace for the file client",
Usage: "basic auth username:password; or just username for password prompt",
},
},
Before: func(ctx *cli.Context) (err error) {
Expand Down
8 changes: 4 additions & 4 deletions functional-tests/admin_tests/performance_test_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dgate-cli domain create \
namespace=test-ns1

dgate-cli service create \
name=test-svc urls:='["http://localhost:8080"]' \
name=test-svc urls:='["http://localhost:8888"]' \
namespace=test-ns1

MOD_B64="$(base64 < $DIR/performance_test_prep.ts)"
Expand Down Expand Up @@ -52,8 +52,8 @@ dgate-cli route create \
namespace=test-ns1


curl ${PROXY_URL}/svctest -H Host:dgate.dev
curl -s ${PROXY_URL}/svctest -H Host:dgate.dev

curl ${PROXY_URL}/modtest -H Host:dgate.dev
curl -s ${PROXY_URL}/modtest -H Host:dgate.dev

curl ${PROXY_URL}/blank -H Host:dgate.dev
curl -s ${PROXY_URL}/blank -H Host:dgate.dev
17 changes: 0 additions & 17 deletions functional-tests/admin_tests/raft_test.sh

This file was deleted.

29 changes: 14 additions & 15 deletions performance-tests/perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ import { check } from 'k6';
const n = 10;
export let options = {
scenarios: {
modtest: {
executor: 'constant-vus',
vus: n,
duration: '20s',
// same function as the scenario above, but with different env vars
exec: 'dgatePath',
env: { DGATE_PATH: '/modtest' },
// startTime: '25s',
gracefulStop: '5s',
},
// svctest: {
// modtest: {
// executor: 'constant-vus',
// vus: n,
// duration: '20s',
// exec: 'dgatePath', // same function as the scenario above, but with different env vars
// env: { DGATE_PATH: "/svctest" },
// // same function as the scenario above, but with different env vars
// exec: 'dgatePath',
// env: { DGATE_PATH: '/modtest' },
// // startTime: '25s',
// gracefulStop: '5s',
// },
svctest: {
executor: 'constant-vus',
vus: n,
duration: '20s',
exec: 'dgatePath', // same function as the scenario above, but with different env vars
env: { DGATE_PATH: "/svctest" },
// startTime: '25s',
gracefulStop: '5s',
},
// blank: {
// executor: 'constant-vus',
// vus: n,
Expand All @@ -36,9 +36,8 @@ export let options = {
discardResponseBodies: true,
};

const dgatePath = __ENV.PROXY_URL || 'http://localhost';

export function dgatePath() {
const dgatePath = __ENV.PROXY_URL || 'http://localhost';
const path = __ENV.DGATE_PATH;
let res = http.get(dgatePath + path, {
headers: { Host: 'dgate.dev' },
Expand Down

0 comments on commit b631b26

Please sign in to comment.