From 58a579870ef850307a13b131771ded1ab5a9073a Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Sat, 5 Aug 2023 18:26:45 +0200 Subject: [PATCH] chore: manage flake --- source/utils/strings_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/utils/strings_test.go b/source/utils/strings_test.go index 7c08366..7c3066e 100644 --- a/source/utils/strings_test.go +++ b/source/utils/strings_test.go @@ -4,8 +4,10 @@ package utils import ( + "fmt" "os" "path/filepath" + "runtime" "testing" ) @@ -21,11 +23,16 @@ func TestMaskCodeBlocks(t *testing.T) { for _, table := range tables { - p, _ := os.Getwd() + //p, _ := os.Getwd() + _, p, _, _ := runtime.Caller(0) // p = filepath.Dir(p) // go to parent directory p = filepath.Dir(p) // go to parent directory + p = filepath.Dir(p) // go to parent directory + p = filepath.Dir(p) // go to parent directory p = filepath.Join(p, table.input) + fmt.Println(p) + code, err := os.ReadFile(p) if err != nil { t.Errorf("Error reading file %s", table.input) -- GitLab