Browse Source

Merge pull request #1773 from Zillode/fix-browser

Do not launch browser when running integration tests
Jakob Borg 10 years ago
parent
commit
2493ae4c2c
2 changed files with 5 additions and 4 deletions
  1. 3 3
      test/cli_test.go
  2. 2 1
      test/syncthingprocess.go

+ 3 - 3
test/cli_test.go

@@ -31,7 +31,7 @@ func TestCLIReset(t *testing.T) {
 
 	// Run reset to clean up
 
-	cmd := exec.Command("../bin/syncthing", "-home", "h1", "-reset")
+	cmd := exec.Command("../bin/syncthing", "-no-browser", "-home", "h1", "-reset")
 	cmd.Stdout = os.Stdout
 	cmd.Stderr = os.Stdout
 	err := cmd.Run()
@@ -65,7 +65,7 @@ func TestCLIGenerate(t *testing.T) {
 
 	// -generate should create a bunch of stuff
 
-	cmd := exec.Command("../bin/syncthing", "-generate", "home.out")
+	cmd := exec.Command("../bin/syncthing", "-no-browser", "-generate", "home.out")
 	cmd.Stdout = os.Stdout
 	cmd.Stderr = os.Stdout
 	err = cmd.Run()
@@ -91,7 +91,7 @@ func TestCLIFirstStartup(t *testing.T) {
 
 	// First startup should create config, BEP certificate, and HTTP certificate.
 
-	cmd := exec.Command("../bin/syncthing", "-home", "home.out")
+	cmd := exec.Command("../bin/syncthing", "-no-browser", "-home", "home.out")
 	cmd.Env = append(os.Environ(), "STNORESTART=1")
 	cmd.Stdout = os.Stdout
 	cmd.Stderr = os.Stdout

+ 2 - 1
test/syncthingprocess.go

@@ -66,7 +66,8 @@ func (p *syncthingProcess) start() error {
 		binary = binary + "-" + p.instance + ".exe"
 	}
 
-	cmd := exec.Command(binary, p.argv...)
+	argv := append(p.argv, "-no-browser")
+	cmd := exec.Command(binary, argv...)
 	cmd.Stdout = p.logfd
 	cmd.Stderr = p.logfd
 	cmd.Env = append(os.Environ(), env...)