Skip to content

Commit efa2fcc

Browse files
committed
add some fail nows
1 parent b199bc3 commit efa2fcc

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

integrations/gpg_git_test.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,19 @@ func TestGPGGit(t *testing.T) {
125125
t.Run("CreateCRUDFile-Always", crudActionCreateFile(
126126
t, testCtx, user, "master", "always", "signed-always.txt", func(t *testing.T, response api.FileResponse) {
127127
assert.True(t, response.Verification.Verified)
128+
if !response.Verification.Verified {
129+
t.FailNow()
130+
return
131+
}
128132
assert.Equal(t, "[email protected]", response.Verification.Signer.Email)
129133
}))
130134
t.Run("CreateCRUDFile-ParentSigned-always", crudActionCreateFile(
131135
t, testCtx, user, "parentsigned", "parentsigned-always", "signed-parent2.txt", func(t *testing.T, response api.FileResponse) {
132136
assert.True(t, response.Verification.Verified)
137+
if !response.Verification.Verified {
138+
t.FailNow()
139+
return
140+
}
133141
assert.Equal(t, "[email protected]", response.Verification.Signer.Email)
134142
}))
135143
})
@@ -144,6 +152,10 @@ func TestGPGGit(t *testing.T) {
144152
t.Run("CreateCRUDFile-Always-ParentSigned", crudActionCreateFile(
145153
t, testCtx, user, "always", "always-parentsigned", "signed-always-parentsigned.txt", func(t *testing.T, response api.FileResponse) {
146154
assert.True(t, response.Verification.Verified)
155+
if !response.Verification.Verified {
156+
t.FailNow()
157+
return
158+
}
147159
assert.Equal(t, "[email protected]", response.Verification.Signer.Email)
148160
}))
149161
})
@@ -160,6 +172,10 @@ func TestGPGGit(t *testing.T) {
160172
assert.NotNil(t, branch.Commit)
161173
assert.NotNil(t, branch.Commit.Verification)
162174
assert.True(t, branch.Commit.Verification.Verified)
175+
if !branch.Commit.Verification.Verified {
176+
t.FailNow()
177+
return
178+
}
163179
assert.Equal(t, "[email protected]", branch.Commit.Verification.Signer.Email)
164180
}))
165181
})
@@ -188,6 +204,10 @@ func TestGPGGit(t *testing.T) {
188204
t.Run("CreateCRUDFile-ParentSigned", crudActionCreateFile(
189205
t, testCtx, user, "master", "parentsigned", "signed-parent.txt", func(t *testing.T, response api.FileResponse) {
190206
assert.True(t, response.Verification.Verified)
207+
if !response.Verification.Verified {
208+
t.FailNow()
209+
return
210+
}
191211
assert.Equal(t, "[email protected]", response.Verification.Signer.Email)
192212
}))
193213
})
@@ -203,6 +223,10 @@ func TestGPGGit(t *testing.T) {
203223
t.Run("CreateCRUDFile-Always", crudActionCreateFile(
204224
t, testCtx, user, "master", "always", "signed-always.txt", func(t *testing.T, response api.FileResponse) {
205225
assert.True(t, response.Verification.Verified)
226+
if !response.Verification.Verified {
227+
t.FailNow()
228+
return
229+
}
206230
assert.Equal(t, "[email protected]", response.Verification.Signer.Email)
207231
}))
208232

@@ -289,7 +313,7 @@ func crudActionCreateFile(t *testing.T, ctx APITestContext, user *models.User, f
289313
Email: user.Email,
290314
},
291315
},
292-
Content: base64.StdEncoding.EncodeToString([]byte("This is new text")),
316+
Content: base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("This is new text for %s", path))),
293317
}, callback...)
294318
}
295319

0 commit comments

Comments
 (0)