cmd/transfer_test: skip some failing tests that

are in need of rewrite and add comments referencing issue #24
This commit is contained in:
Nick Sherron 2022-01-12 05:13:12 -05:00
parent 2a0f3bc17a
commit bbae055e69
No known key found for this signature in database
GPG key ID: 3D8176919889DF27

View file

@ -75,7 +75,6 @@ func init() {
flag.BoolVar(&testWork, "testwork", false, "don't remove sqlite db and server log when done and print location")
flag.StringVar(&srcPostgres, "src-postgres-uri", "", "postgres uri to use for postgres tests")
flag.StringVar(&dstPostgres, "dst-postgres-uri", "", "postgres uri to use for postgres tests")
}
func (u user) startServer() (p *exec.Cmd, err error) {
@ -89,8 +88,10 @@ func (u user) startServer() (p *exec.Cmd, err error) {
if cmd, err = exec.LookPath(cmd); err == nil {
var procAttr os.ProcAttr
procAttr.Dir = parent
procAttr.Files = []*os.File{os.Stdin,
os.Stdout, os.Stderr}
procAttr.Files = []*os.File{
os.Stdin,
os.Stdout, os.Stderr,
}
p := exec.Command(cmd, args...)
p.Dir = parent
p.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
@ -154,6 +155,9 @@ func setup(srcDB string, dstDB string) {
}
func TestMain(m *testing.M) {
// TODO: determine why tests are failing and rewrite this awful code, I was just learing go when this was written
// and it shows. See #24
flag.Parse()
var err error
testDir, err = ioutil.TempDir("", "bashhub-server-test-")
@ -205,7 +209,6 @@ func (u user) createUser() {
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
func TestCreateToken(t *testing.T) {
@ -324,5 +327,4 @@ func cleanup() {
return
}
log.SetOutput(os.Stderr)
}