-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
23 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,21 +10,19 @@ import ( | |
|
||
func Test_pluginInstallCmd(t *testing.T) { | ||
// Create a test config file. | ||
pluginConfigFile := "./test.yaml" | ||
output, err := executeCommandC(rootCmd, "plugin", "init", "-p", pluginConfigFile) | ||
output, err := executeCommandC(rootCmd, "plugin", "init", "-p", pluginTestConfigFile) | ||
assert.NoError(t, err, "plugin init should not return an error") | ||
assert.Equal(t, | ||
fmt.Sprintf("Config file '%s' was created successfully.", pluginConfigFile), | ||
fmt.Sprintf("Config file '%s' was created successfully.", pluginTestConfigFile), | ||
output, | ||
"plugin init command should have returned the correct output") | ||
assert.FileExists(t, pluginConfigFile, "plugin init command should have created a config file") | ||
assert.FileExists(t, pluginTestConfigFile, "plugin init command should have created a config file") | ||
|
||
// Test plugin install command. | ||
output, err = executeCommandC( | ||
rootCmd, "plugin", "install", | ||
"github.com/gatewayd-io/[email protected]", "-p", pluginConfigFile) | ||
"github.com/gatewayd-io/[email protected]", "-p", pluginTestConfigFile) | ||
assert.NoError(t, err, "plugin install should not return an error") | ||
fmt.Println(output) | ||
assert.Contains(t, output, "Downloading https://github.com/gatewayd-io/gatewayd-plugin-cache/releases/download/v0.2.4/gatewayd-plugin-cache-linux-amd64-v0.2.4.tar.gz") //nolint:lll | ||
assert.Contains(t, output, "Downloading https://github.com/gatewayd-io/gatewayd-plugin-cache/releases/download/v0.2.4/checksums.txt") //nolint:lll | ||
assert.Contains(t, output, "Download completed successfully") | ||
|
@@ -33,13 +31,13 @@ func Test_pluginInstallCmd(t *testing.T) { | |
assert.Contains(t, output, "Plugin installed successfully") | ||
|
||
// See if the plugin was actually installed. | ||
output, err = executeCommandC(rootCmd, "plugin", "list", "-p", pluginConfigFile) | ||
output, err = executeCommandC(rootCmd, "plugin", "list", "-p", pluginTestConfigFile) | ||
assert.NoError(t, err, "plugin list should not return an error") | ||
assert.Contains(t, output, "Name: gatewayd-plugin-cache") | ||
|
||
// Clean up. | ||
assert.NoError(t, os.RemoveAll("plugins/")) | ||
assert.NoError(t, os.Remove("checksums.txt")) | ||
assert.NoError(t, os.Remove("gatewayd-plugin-cache-linux-amd64-v0.2.4.tar.gz")) | ||
assert.NoError(t, os.Remove(pluginConfigFile)) | ||
assert.NoError(t, os.Remove(pluginTestConfigFile)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters