diff --git a/main.go b/main.go index 15de0bd..e1fec5d 100644 --- a/main.go +++ b/main.go @@ -188,13 +188,20 @@ func runApiTests(cmd *cobra.Command, args []string) { return suite.Run() } + currDir, _ := os.Getwd() + absPath := func(p string) string { + if filepath.IsAbs(p) { + return p + } + return filepath.Join(currDir, p) + } + // Decide if run only one test if len(singleTests) > 0 { for _, singleTest := range singleTests { - absManifestPath, _ := filepath.Abs(singleTest) c := rep.Root().NewChild(singleTest) - success := runSingleTest(absManifestPath, singleTest, c) + success := runSingleTest(absPath(singleTest), singleTest, c) c.Leave(success) if stopOnFail && !success { @@ -204,10 +211,9 @@ func runApiTests(cmd *cobra.Command, args []string) { } else { for _, singlerootDirectory := range testToolConfig.TestDirectories { manifestPath := filepath.Join(singlerootDirectory, "manifest.json") - absManifestPath, _ := filepath.Abs(manifestPath) c := rep.Root().NewChild(manifestPath) - success := runSingleTest(absManifestPath, manifestPath, c) + success := runSingleTest(absPath(manifestPath), manifestPath, c) c.Leave(success) if stopOnFail && !success { diff --git a/pkg/lib/template/template_loader.go b/pkg/lib/template/template_loader.go index 8788f6d..179e895 100644 --- a/pkg/lib/template/template_loader.go +++ b/pkg/lib/template/template_loader.go @@ -335,7 +335,7 @@ func (loader *Loader) Render( return reflect.ValueOf(v).IsZero() }, "oauth2_password_token": func(client string, login string, password string) (tok *oauth2.Token, err error) { - println("client", client, login, password) + // println("client", client, login, password) oAuthClient, ok := loader.OAuthClient[client] if !ok { return nil, errors.Errorf("OAuth client %q not configured", client)