Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Dec 23, 2024
1 parent 39d7b3e commit 6debf66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/http_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
// Test_HTTP_Server tests the HTTP to gRPC gateway.
func Test_HTTP_Server(t *testing.T) {
api := getAPIConfig()
api.Servers[config.Default].Address = ":0"
healthchecker := &HealthChecker{Servers: api.Servers}
grpcServer := NewGRPCServer(
context.Background(), GRPCServer{API: api, HealthChecker: healthchecker})
Expand Down
2 changes: 2 additions & 0 deletions cmd/plugin_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

func Test_pluginInstallCmd(t *testing.T) {
pluginTestConfigFile := "./test_plugins_pluginInstallCmd.yaml"
// TODO: hack
App.PluginConfigFile = pluginTestConfigFile

// Create a test plugin config file.
output, err := executeCommandC(rootCmd, "plugin", "init", "-p", pluginTestConfigFile)
Expand Down
6 changes: 6 additions & 0 deletions cmd/plugin_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (

func Test_pluginListCmd(t *testing.T) {
pluginTestConfigFile := "./test_plugins_pluginListCmd.yaml"
// TODO: Hack to ensure the plugin config file is created before running the plugin list command. REMOVE THIS HACK.
App.PluginConfigFile = pluginTestConfigFile

// Test plugin list command.
output, err := executeCommandC(rootCmd, "plugin", "init", "-p", pluginTestConfigFile)
require.NoError(t, err, "plugin init command should not have returned an error")
Expand All @@ -36,6 +39,9 @@ func Test_pluginListCmdWithPlugins(t *testing.T) {
// Test plugin list command.
// Read the plugin config file from the root directory.
pluginTestConfigFile := "../gatewayd_plugins.yaml"
// TODO: Hack to ensure the plugin config file is created before running the plugin list command. REMOVE THIS HACK.
App.PluginConfigFile = pluginTestConfigFile

output, err := executeCommandC(rootCmd, "plugin", "list", "-p", pluginTestConfigFile)
require.NoError(t, err, "plugin list command should not have returned an error")
assert.Contains(t,
Expand Down

0 comments on commit 6debf66

Please sign in to comment.