aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2019-10-23 23:03:17 -0700
committerGitHub <noreply@github.com>2019-10-23 23:03:17 -0700
commit613139e7bef81d3573e7988a47eb6765f3de347a (patch)
tree49de7277898d3ff47a122c072568edb8ed4c9ac9 /vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go
parentfb100dbf98f02e4c631d142ff0f52ec29ee2f00c (diff)
Enable Go modules (#5835)
* Remove vendor * Enable Go modules * ci: add command to fetch dependencies * ci: update setting * ci: update settings * Require Go 1.11 * Rename module name to gogs.io/gogs
Diffstat (limited to 'vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go')
-rw-r--r--vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go b/vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go
deleted file mode 100644
index 76f353a5..00000000
--- a/vendor/github.com/smartystreets/goconvey/web/server/executor/tester.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package executor
-
-import (
- "errors"
- "fmt"
- "log"
- "strings"
-
- "github.com/smartystreets/goconvey/web/server/contract"
-)
-
-type ConcurrentTester struct {
- shell contract.Shell
- batchSize int
-}
-
-func (self *ConcurrentTester) SetBatchSize(batchSize int) {
- self.batchSize = batchSize
- log.Printf("Now configured to test %d packages concurrently.\n", self.batchSize)
-}
-
-func (self *ConcurrentTester) TestAll(folders []*contract.Package) {
- if self.batchSize == 1 {
- self.executeSynchronously(folders)
- } else {
- newConcurrentCoordinator(folders, self.batchSize, self.shell).ExecuteConcurrently()
- }
- return
-}
-
-func (self *ConcurrentTester) executeSynchronously(folders []*contract.Package) {
- for _, folder := range folders {
- packageName := strings.Replace(folder.Name, "\\", "/", -1)
- if !folder.Active() {
- log.Printf("Skipping execution: %s\n", packageName)
- continue
- }
- if folder.HasImportCycle {
- message := fmt.Sprintf("can't load package: import cycle not allowed\npackage %s\n\timports %s", packageName, packageName)
- log.Println(message)
- folder.Output, folder.Error = message, errors.New(message)
- } else {
- log.Printf("Executing tests: %s\n", packageName)
- folder.Output, folder.Error = self.shell.GoTest(folder.Path, packageName, folder.BuildTags, folder.TestArguments)
- }
- }
-}
-
-func NewConcurrentTester(shell contract.Shell) *ConcurrentTester {
- self := new(ConcurrentTester)
- self.shell = shell
- self.batchSize = defaultBatchSize
- return self
-}
-
-const defaultBatchSize = 10