Browse Source

Short benchmark test only by default

Jakob Borg 11 years ago
parent
commit
6f750582dd
2 changed files with 7 additions and 2 deletions
  1. 1 1
      test/all.sh
  2. 6 1
      test/transfer-bench_test.go

+ 1 - 1
test/all.sh

@@ -2,7 +2,7 @@
 set -euo pipefail
 IFS=$'\n\t'
 
-go test -tags integration -v
+go test -tags integration -v -short
 ./test-http.sh
 ./test-merge.sh
 ./test-delupd.sh

+ 6 - 1
test/transfer-bench_test.go

@@ -14,6 +14,11 @@ import (
 )
 
 func TestBenchmarkTransfer(t *testing.T) {
+	nfiles := 10000
+	if testing.Short() {
+		nfiles = 1000
+	}
+
 	log.Println("Cleaning...")
 	err := removeAll("s1", "s2", "h1/index", "h2/index")
 	if err != nil {
@@ -21,7 +26,7 @@ func TestBenchmarkTransfer(t *testing.T) {
 	}
 
 	log.Println("Generating files...")
-	err = generateFiles("s1", 10000, 22, "../bin/syncthing")
+	err = generateFiles("s1", nfiles, 22, "../bin/syncthing")
 	if err != nil {
 		t.Fatal(err)
 	}