コード例 #1
0
func TestCloudConfig(t *testing.T) {
	RegisterFailHandler(Fail)
	if os.Getenv("TEAMCITY") == "true" {
		RunSpecsWithCustomReporters(t, "CloudConfig Test Suite", []Reporter{reporters.NewTeamCityReporter(os.Stdout)})
	} else {
		RunSpecs(t, "CloudConfig Test Suite")
	}
}
コード例 #2
0
ファイル: logger_test.go プロジェクト: johnt337/cloudconfig
func TestLogger(t *testing.T) {
	RegisterFailHandler(Fail)
	if os.Getenv("TEAMCITY") == "true" {
		RunSpecsWithCustomReporters(t, suite, []Reporter{reporters.NewTeamCityReporter(os.Stdout)})
	} else {
		RunSpecs(t, suite)
	}
}
コード例 #3
0
ファイル: cache_suite_test.go プロジェクト: warmfusion/cache
func TestCache(t *testing.T) {
	flag.Parse()

	RegisterFailHandler(Fail)
	if *tcReport {
		RunSpecsWithCustomReporters(t, "Cache Suite", []Reporter{reporters.NewTeamCityReporter(os.Stdout)})
	} else {
		RunSpecs(t, "Cache Suite")
	}
}
コード例 #4
0
	"github.com/onsi/ginkgo/config"
	"github.com/onsi/ginkgo/reporters"
	"github.com/onsi/ginkgo/types"
	. "github.com/onsi/gomega"
	"time"
)

var _ = Describe("TeamCity Reporter", func() {
	var (
		buffer   bytes.Buffer
		reporter Reporter
	)

	BeforeEach(func() {
		buffer.Truncate(0)
		reporter = reporters.NewTeamCityReporter(&buffer)
		reporter.SpecSuiteWillBegin(config.GinkgoConfigType{}, &types.SuiteSummary{
			SuiteDescription:              "Foo's test suite",
			NumberOfExamplesThatWillBeRun: 1,
		})
	})

	Describe("a passing test", func() {
		BeforeEach(func() {
			example := &types.ExampleSummary{
				ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
				State:          types.ExampleStatePassed,
				RunTime:        5 * time.Second,
			}
			reporter.ExampleWillRun(example)
			reporter.ExampleDidComplete(example)