Open siretart opened 2 weeks ago
hey - yeah the intent wasn't to support running the ginkgo test suite with the environment variable on. but i can dig into fixing it.
remind me again why you can't just use ginkgo -no-color
?
In Debian, we purposefully disable go111 modules to avoid downloading sources from the Internet. Instead, all dependencies come from the Debian archive. To do this at scale, we have helpers that set the appropriate environment variables and carefully construct the build trees. For better or worse, these helpers have the testing part of the Debian package build hardcoded with go test
, and this is not easy to replace.
@onsi Hey, can create multi suit in same path? I try write 2 suit in same file, run failed.
I want to diff case in diff suit, if right op? bucket_test.go
package test_test
import (
"fmt"
"net/http"
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestBucket(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Bucket Suite")
}
var _ = Describe("Bucket", func() {
Context("HeadBucket", func() {
It("normal request, http statu 200", func() {
url := "https://example.com"
resp, err := http.Head(url)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
})
})
Context("GetBucket", func() {
It("should authenticate an admin user with valid token", func() {
})
})
})
func TestObject(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Object Suite")
}
var _ = Describe("Object", func() {
Context("HeadBucket", func() {
It("normal request, http statu 200", func() {
url := "https://example.com"
resp, err := http.Head(url)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
})
})
Context("GetBucket", func() {
It("should authenticate an admin user with valid token", func() {
})
})
})
Rerunning Suite
It looks like you are calling RunSpecs more than once. Ginkgo does not support
rerunning suites. If you want to rerun a suite try ginkgo --repeat=N or
ginkgo --until-it-fails
Learn more at:
http://onsi.github.io/ginkgo/#repeating-spec-runs-and-managing-flaky-specs
Ginkgo ran 1 suite in 2.666139542s
hey @zhaohuxing this looks like it should be a new, different issue. can you open one if you'd like to discuss it further?
For now: you don't need separate TestX
or to call RunSpecs
more than once. You simply need to define all the Ginkgo specs (and you can split them across multiple files in the same package) and Ginkgo will collect them all and run them all.
I don't think my original implementation in #1464 had this issue though...