refactor: project structure
This commit is contained in:
33
pkg/watcher_test.go
Normal file
33
pkg/watcher_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package pkg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.urkob.com/urko/git-webhook-ci/kit/cfg"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var (
|
||||
binaryPath = "/bin/bash"
|
||||
scriptPath = cfg.RootDir() + "/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)
|
||||
}
|
||||
Reference in New Issue
Block a user