当前位置: 首页>>代码示例>>Golang>>正文


Golang testing.Status函数代码示例

本文整理汇总了Golang中k8s/io/contrib/mungegithub/github/testing.Status函数的典型用法代码示例。如果您正苦于以下问题:Golang Status函数的具体用法?Golang Status怎么用?Golang Status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Status函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NowStatus

func NowStatus() *github.CombinedStatus {
	status := github_test.Status("mysha", []string{travisContext, jenkinsUnitContext, jenkinsE2EContext}, nil, nil, nil)
	for i := range status.Statuses {
		s := &status.Statuses[i]
		s.CreatedAt = timePtr(time.Now())
		s.UpdatedAt = timePtr(time.Now())
	}
	return status
}
开发者ID:timstclair,项目名称:kube-contrib,代码行数:9,代码来源:stale-green-ci_test.go

示例2: NowStatus

func NowStatus() *github.CombinedStatus {
	status := github_test.Status("mysha", requiredContexts, nil, nil, nil)
	for i := range status.Statuses {
		s := &status.Statuses[i]
		s.CreatedAt = timePtr(time.Now())
		s.UpdatedAt = timePtr(time.Now())
	}
	return status
}
开发者ID:raggi,项目名称:contrib,代码行数:9,代码来源:stale-green-ci_test.go

示例3: GithubE2EFailStatus

func GithubE2EFailStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{travisContext, jenkinsUnitContext}, []string{jenkinsE2EContext}, nil, nil)
}
开发者ID:resouer,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例4: NoRetestFailStatus

func NoRetestFailStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{requiredReTestContext1, requiredReTestContext2, notRequiredReTestContext1}, []string{notRequiredReTestContext2}, nil, nil)
}
开发者ID:danielibrahim,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例5: SuccessStatus

func SuccessStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{requiredReTestContext1, requiredReTestContext2, notRequiredReTestContext1, notRequiredReTestContext2}, nil, nil, nil)
}
开发者ID:danielibrahim,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例6: TestComputeStatus

func TestComputeStatus(t *testing.T) {
	contextS := []string{"context"}
	otherS := []string{"other context"}
	bothS := []string{"context", "other context"}
	firstS := []string{"context", "crap"}

	tests := []struct {
		combinedStatus   *github.CombinedStatus
		requiredContexts []string
		expected         string
	}{
		// test no context specified
		{
			combinedStatus: github_test.Status("mysha", nil, nil, nil, nil),
			expected:       "success",
		},
		{
			combinedStatus: &github.CombinedStatus{
				State: stringPtr("pending"),
				SHA:   stringPtr("mysha"),
			},
			expected: "pending",
		},
		{
			combinedStatus: &github.CombinedStatus{
				State: stringPtr("failure"),
				SHA:   stringPtr("mysha"),
			},
			expected: "failure",
		},
		{
			combinedStatus: &github.CombinedStatus{
				State: stringPtr("error"),
				SHA:   stringPtr("mysha"),
			},
			expected: "error",
		},
		// test missing subcontext requested but missing
		{
			combinedStatus:   github_test.Status("mysha", otherS, nil, nil, nil),
			requiredContexts: contextS,
			expected:         "incomplete",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, otherS, nil, nil),
			requiredContexts: contextS,
			expected:         "incomplete",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, nil, otherS, nil),
			requiredContexts: contextS,
			expected:         "incomplete",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, nil, nil, otherS),
			requiredContexts: contextS,
			expected:         "incomplete",
		},
		// test subcontext present and requested
		{
			combinedStatus:   github_test.Status("mysha", contextS, nil, nil, nil),
			requiredContexts: contextS,
			expected:         "success",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, nil, contextS, nil),
			requiredContexts: contextS,
			expected:         "pending",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, nil, nil, contextS),
			requiredContexts: contextS,
			expected:         "error",
		},
		{
			combinedStatus:   github_test.Status("mysha", nil, contextS, nil, nil),
			requiredContexts: contextS,
			expected:         "failure",
		},
		// test failed PR but the one we care about is passed
		{
			combinedStatus:   github_test.Status("mysha", contextS, otherS, nil, nil),
			requiredContexts: contextS,
			expected:         "success",
		},
		// test failed because we need both, but one is failed
		{
			combinedStatus:   github_test.Status("mysha", contextS, otherS, nil, nil),
			requiredContexts: bothS,
			expected:         "failure",
		},
		// test failed because we need both, bot one isn't present
		{
			combinedStatus:   github_test.Status("mysha", firstS, nil, nil, nil),
			requiredContexts: bothS,
			expected:         "incomplete",
		},
	}

	for _, test := range tests {
//.........这里部分代码省略.........
开发者ID:krousey,项目名称:contrib,代码行数:101,代码来源:github_test.go

示例7: GithubE2EFailStatus

func GithubE2EFailStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{claContext, shippableContext, travisContext}, []string{gceE2EContext}, nil, nil)
}
开发者ID:jangaraj,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例8: JenkinsCIGreenShippablePendingStatus

func JenkinsCIGreenShippablePendingStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{claContext, jenkinsCIContext, travisContext, gceE2EContext}, nil, []string{shippableContext}, nil)
}
开发者ID:jangaraj,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例9: SuccessStatus

func SuccessStatus() *github.CombinedStatus {
	return github_test.Status("mysha", []string{claContext, shippableContext, travisContext, jenkinsCIContext, gceE2EContext}, nil, nil, nil)
}
开发者ID:jangaraj,项目名称:contrib,代码行数:3,代码来源:submit-queue_test.go

示例10: OldStatus

func OldStatus() *github.CombinedStatus {
	return github_test.Status("mysha", requiredContexts, nil, nil, nil)
}
开发者ID:raggi,项目名称:contrib,代码行数:3,代码来源:stale-green-ci_test.go


注:本文中的k8s/io/contrib/mungegithub/github/testing.Status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。