forked from toolshed/abra
fix: app cmd parsing, usage & tests
Note: the integration tests don't work due to ValidateApp still attempting to validate the host key for the test app which doesn't exist. This will be fixed in a future commit.
This commit is contained in:
38
pkg/test/test.go
Normal file
38
pkg/test/test.go
Normal file
@ -0,0 +1,38 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// RmServerAppRecipe deletes the test server / app / recipe.
|
||||
func RmServerAppRecipe() {
|
||||
testAppLink := os.ExpandEnv("$HOME/.abra/servers/foo.com")
|
||||
if err := os.Remove(testAppLink); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
testRecipeLink := os.ExpandEnv("$HOME/.abra/recipes/test")
|
||||
if err := os.Remove(testRecipeLink); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// MkServerAppRecipe symlinks the test server / app / recipe.
|
||||
func MkServerAppRecipe() {
|
||||
RmServerAppRecipe()
|
||||
|
||||
testAppDir := os.ExpandEnv("$PWD/../../tests/resources/testapp")
|
||||
testAppLink := os.ExpandEnv("$HOME/.abra/servers/foo.com")
|
||||
if err := os.Symlink(testAppDir, testAppLink); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
testRecipeDir := os.ExpandEnv("$PWD/../../tests/resources/testrecipe")
|
||||
testRecipeLink := os.ExpandEnv("$HOME/.abra/recipes/test")
|
||||
if err := os.Symlink(testRecipeDir, testRecipeLink); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user