From edc30ffdb99da0692057a2d754704522abd36533 Mon Sep 17 00:00:00 2001 From: Ying Li Date: Tue, 19 Jan 2016 09:42:17 -0800 Subject: [PATCH] Skip the longer client update tests if testing in short mode. Signed-off-by: Ying Li --- client/client_update_test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/client/client_update_test.go b/client/client_update_test.go index 9cad3beaaa..bf519f0eba 100644 --- a/client/client_update_test.go +++ b/client/client_update_test.go @@ -143,6 +143,9 @@ func (u *unwritableStore) SetMeta(role string, meta []byte) error { // Update can succeed even if we cannot write any metadata to the repo (assuming // no data in the repo) func TestUpdateSucceedsEvenIfCannotWriteNewRepo(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } s, err := testutils.NewMetadataSwizzler("docker.com/notary") require.NoError(t, err) @@ -183,6 +186,9 @@ func TestUpdateSucceedsEvenIfCannotWriteNewRepo(t *testing.T) { // Update can succeed even if we cannot write any metadata to the repo (assuming // existing data in the repo) func TestUpdateSucceedsEvenIfCannotWriteExistingRepo(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } s, err := testutils.NewMetadataSwizzler("docker.com/notary") require.NoError(t, err) @@ -237,6 +243,9 @@ type messUpMetadata func(role string) error // If a repo has corrupt metadata (in that the hash doesn't match the snapshot) or // missing metadata, an update will replace all of it func TestUpdateReplacesCorruptOrMissingMetadata(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } s, err := testutils.NewMetadataSwizzler("docker.com/notary") require.NoError(t, err) @@ -258,7 +267,7 @@ func TestUpdateReplacesCorruptOrMissingMetadata(t *testing.T) { waysToMessUp := map[string]messUpMetadata{ "invalid JSON": swizzler.SetInvalidJSON, - "missing metadata": swizzler.DeleteMetadata, + "missing metadata": swizzler.RemoveMetadata, } for _, role := range s.Roles { for text, messItUp := range waysToMessUp { @@ -283,6 +292,9 @@ func TestUpdateReplacesCorruptOrMissingMetadata(t *testing.T) { // the repo will just get the new root from the server, whether or not the update // is for writing (forced update) func TestUpdateWhenLocalRootRecoverablyCorrupt(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } s, err := testutils.NewMetadataSwizzler("docker.com/notary") require.NoError(t, err) @@ -346,6 +358,9 @@ func TestUpdateWhenLocalRootRecoverablyCorrupt(t *testing.T) { // it will refuse to update if the root key has changed and the new root is // not signed by the old and new key func TestUpdateFailsIfServerRootKeyChangedWithoutMultiSign(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } serverSwizzler, err := testutils.NewMetadataSwizzler("docker.com/notary") require.NoError(t, err)