mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-09-03 00:47:17 +00:00
* feat(redactors): Run redactors on an existing support bundle Add redact subcommand to support-bundle to allow running redactors on an existing bundle to creating a new redacted bundle. The command will be launched like so support-bundle redact <redactor urls> --bundle support-bundle.tar.gz Fixes: #705
25 lines
458 B
Go
25 lines
458 B
Go
package testutils
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func GetTestFixture(t *testing.T, path string) string {
|
|
t.Helper()
|
|
p := filepath.Join("../../testdata", path)
|
|
b, err := os.ReadFile(p)
|
|
require.NoError(t, err)
|
|
return string(b)
|
|
}
|
|
|
|
// FileDir returns the directory of the current source file.
|
|
func FileDir() string {
|
|
_, filename, _, _ := runtime.Caller(0)
|
|
return filepath.Dir(filename)
|
|
}
|