mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-26 22:24:59 +08:00
sops-pgp-hook: set parallel and helper
This commit is contained in:
parent
15541d542b
commit
9190dee408
1 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue