sops-pgp-hook: set parallel and helper

This commit is contained in:
Jörg Thalheim 2024-11-17 18:42:20 +01:00
parent 15541d542b
commit 9190dee408

View file

@ -6,7 +6,6 @@ import (
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"
"testing"
@ -14,14 +13,17 @@ import (
// ok fails the test if an err is not nil.
func ok(tb testing.TB, err error) {
tb.Helper()
if err != nil {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
fmt.Printf("\033[31munexpected error: %s\033[39m\n\n", err.Error())
tb.FailNow()
}
}
func TestShellHook(t *testing.T) {
t.Parallel()
assets := os.Getenv("TEST_ASSETS")
if assets == "" {
_, filename, _, _ := runtime.Caller(0)