feat: test pkg watcher
This commit is contained in:
parent
e25b192aff
commit
19f17308b1
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
echo "hello"
|
|
@ -0,0 +1,32 @@
|
|||
package watcher
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var (
|
||||
binaryPath = "/bin/bash"
|
||||
scriptPath = "./test-script.sh"
|
||||
)
|
||||
|
||||
func TestDeploy(t *testing.T) {
|
||||
err := Deploy(binaryPath, scriptPath)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestDeployError(t *testing.T) {
|
||||
err := Deploy("", "")
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestExecute(t *testing.T) {
|
||||
err := execute(binaryPath, scriptPath)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestExecuteError(t *testing.T) {
|
||||
err := execute("", "")
|
||||
require.Error(t, err)
|
||||
}
|
Loading…
Reference in New Issue