fix: Disable telemetry by default in tests (#3200)

I also noticed we don't have `goleak` enabled for CLI tests, this commit
adds it, but commented out. The reason being that we're nowhere near
being able to enable it yet.

Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Mathias Fredriksson
2022-07-26 16:27:48 +03:00
committed by GitHub
co-authored by Cian Johnston
parent 122c6f06d8
commit d1d89210b8
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -1,6 +1,7 @@
package cli
import (
"flag"
"fmt"
"net/url"
"os"
@@ -175,6 +176,10 @@ func versionCmd() *cobra.Command {
}
}
func isTest() bool {
return flag.Lookup("test.v") != nil
}
// createClient returns a new client from the command context.
// It reads from global configuration files if flags are not set.
func createClient(cmd *cobra.Command) (*codersdk.Client, error) {