mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-05-14 01:20:15 +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"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -14,14 +13,17 @@ import (
|
||||||
|
|
||||||
// ok fails the test if an err is not nil.
|
// ok fails the test if an err is not nil.
|
||||||
func ok(tb testing.TB, err error) {
|
func ok(tb testing.TB, err error) {
|
||||||
|
tb.Helper()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_, file, line, _ := runtime.Caller(1)
|
fmt.Printf("\033[31munexpected error: %s\033[39m\n\n", err.Error())
|
||||||
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
|
|
||||||
tb.FailNow()
|
tb.FailNow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestShellHook(t *testing.T) {
|
func TestShellHook(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
assets := os.Getenv("TEST_ASSETS")
|
assets := os.Getenv("TEST_ASSETS")
|
||||||
if assets == "" {
|
if assets == "" {
|
||||||
_, filename, _, _ := runtime.Caller(0)
|
_, filename, _, _ := runtime.Caller(0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue