Skip to content

Commit

Permalink
Teach TestSubmit_Init to fail fast on error
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrudolph committed Jul 17, 2021
1 parent b602036 commit cbc5161
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/cmd/submit/submit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestSubmit_Init(t *testing.T) {
t.Run("MinimumRequiredArgs", func(t *testing.T) {
s := NewSubmit(&metadata.Version{}, logger.New())
err = s.Init([]string{resultsDir, "--account-id", "42", "--repository-id", "8675309"}, exampleEnv, new(stubCommitResolverFactory))
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, resultsDir, s.path)
assert.EqualValues(t, 42, s.accountID)
assert.EqualValues(t, 8675309, s.repositoryID)
Expand All @@ -58,7 +58,7 @@ func TestSubmit_Init(t *testing.T) {
exampleEnv,
new(stubCommitResolverFactory),
)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, resultsDir, s.path)
assert.Equal(t, repoDir, s.repositoryPath)
assert.Equal(t, "Repository", s.commitResolver.Source())
Expand All @@ -71,7 +71,7 @@ func TestSubmit_Init(t *testing.T) {
exampleEnv,
new(stubCommitResolverFactory),
)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, resultsDir, s.path)
assert.Equal(t, "Static", s.commitResolver.Source())
})
Expand All @@ -90,7 +90,7 @@ func TestSubmit_Init(t *testing.T) {
envs,
new(stubCommitResolverFactory),
)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "buildpulse-uploads-test", s.bucket)
})
}
Expand Down

0 comments on commit cbc5161

Please sign in to comment.