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


Golang Task.TestResults方法代码示例

本文整理汇总了Golang中github.com/evergreen-ci/evergreen/model.Task.TestResults方法的典型用法代码示例。如果您正苦于以下问题:Golang Task.TestResults方法的具体用法?Golang Task.TestResults怎么用?Golang Task.TestResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/evergreen-ci/evergreen/model.Task的用法示例。


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

示例1: TestTaskToJQL

func TestTaskToJQL(t *testing.T) {
	Convey("Given a task with with two failed tests and one successful test, "+
		"the jql should contian only the failed test names", t, func() {
		task1 := model.Task{}
		task1.TestResults = []model.TestResult{
			{Status: "fail", TestFile: "foo.js"},
			{Status: "success", TestFile: "bar.js"},
			{Status: "fail", TestFile: "baz.js"},
		}
		task1.DisplayName = "foobar"
		jQL1 := taskToJQL(&task1)
		referenceJQL1 := fmt.Sprintf(JQLBFQuery, "summary~\"foo.js\" or summary~\"baz.js\"")
		So(jQL1, ShouldEqual, referenceJQL1)
	})

	Convey("Given a task with with oo failed tests, "+
		"the jql should contian only the failed task name", t, func() {
		task2 := model.Task{}
		task2.TestResults = []model.TestResult{}
		task2.DisplayName = "foobar"
		jQL2 := taskToJQL(&task2)
		referenceJQL2 := fmt.Sprintf(JQLBFQuery, "summary~\"foobar\"")
		So(jQL2, ShouldEqual, referenceJQL2)
	})
}
开发者ID:ramonfm,项目名称:build-baron-plugin,代码行数:25,代码来源:build_baron_test.go


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