提交 b666163e 作者: Brian Tiger Chow

test(fsrepo)PERF allow tests to run in parallel

上级 6396123b
...@@ -19,6 +19,7 @@ func testRepoPath(p string, t *testing.T) string { ...@@ -19,6 +19,7 @@ func testRepoPath(p string, t *testing.T) string {
} }
func TestInitIdempotence(t *testing.T) { func TestInitIdempotence(t *testing.T) {
t.Parallel()
path := testRepoPath("", t) path := testRepoPath("", t)
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
AssertNil(Init(path, &config.Config{}), t, "multiple calls to init should succeed") AssertNil(Init(path, &config.Config{}), t, "multiple calls to init should succeed")
...@@ -26,11 +27,13 @@ func TestInitIdempotence(t *testing.T) { ...@@ -26,11 +27,13 @@ func TestInitIdempotence(t *testing.T) {
} }
func TestRemove(t *testing.T) { func TestRemove(t *testing.T) {
t.Parallel()
path := testRepoPath("foo", t) path := testRepoPath("foo", t)
AssertNil(Remove(path), t, "should be able to remove after closed") AssertNil(Remove(path), t, "should be able to remove after closed")
} }
func TestCannotRemoveIfOpen(t *testing.T) { func TestCannotRemoveIfOpen(t *testing.T) {
t.Parallel()
path := testRepoPath("TestCannotRemoveIfOpen", t) path := testRepoPath("TestCannotRemoveIfOpen", t)
AssertNil(Init(path, &config.Config{}), t, "should initialize successfully") AssertNil(Init(path, &config.Config{}), t, "should initialize successfully")
r := At(path) r := At(path)
...@@ -41,6 +44,7 @@ func TestCannotRemoveIfOpen(t *testing.T) { ...@@ -41,6 +44,7 @@ func TestCannotRemoveIfOpen(t *testing.T) {
} }
func TestCannotBeReopened(t *testing.T) { func TestCannotBeReopened(t *testing.T) {
t.Parallel()
path := testRepoPath("", t) path := testRepoPath("", t)
AssertNil(Init(path, &config.Config{}), t) AssertNil(Init(path, &config.Config{}), t)
r := At(path) r := At(path)
...@@ -53,6 +57,7 @@ func TestCannotBeReopened(t *testing.T) { ...@@ -53,6 +57,7 @@ func TestCannotBeReopened(t *testing.T) {
} }
func TestCanManageReposIndependently(t *testing.T) { func TestCanManageReposIndependently(t *testing.T) {
t.Parallel()
pathA := testRepoPath("a", t) pathA := testRepoPath("a", t)
pathB := testRepoPath("b", t) pathB := testRepoPath("b", t)
...@@ -80,6 +85,7 @@ func TestCanManageReposIndependently(t *testing.T) { ...@@ -80,6 +85,7 @@ func TestCanManageReposIndependently(t *testing.T) {
} }
func TestDatastoreGetNotAllowedAfterClose(t *testing.T) { func TestDatastoreGetNotAllowedAfterClose(t *testing.T) {
t.Parallel()
path := testRepoPath("test", t) path := testRepoPath("test", t)
Assert(!IsInitialized(path), t, "should NOT be initialized") Assert(!IsInitialized(path), t, "should NOT be initialized")
...@@ -97,6 +103,7 @@ func TestDatastoreGetNotAllowedAfterClose(t *testing.T) { ...@@ -97,6 +103,7 @@ func TestDatastoreGetNotAllowedAfterClose(t *testing.T) {
} }
func TestDatastorePersistsFromRepoToRepo(t *testing.T) { func TestDatastorePersistsFromRepoToRepo(t *testing.T) {
t.Parallel()
path := testRepoPath("test", t) path := testRepoPath("test", t)
AssertNil(Init(path, &config.Config{}), t) AssertNil(Init(path, &config.Config{}), t)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论