Skip to content

Commit

Permalink
chore: error lints
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
  • Loading branch information
markphelps committed Feb 21, 2025
1 parent e38245b commit 374300a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestGetExporter(t *testing.T) {

exp, expFunc, err := GetExporter(context.Background(), tt.cfg)
if tt.wantErr != nil {
assert.EqualError(t, err, tt.wantErr.Error())
require.EqualError(t, err, tt.wantErr.Error())
assert.Nil(t, exp, "expected nil exporter when error occurs")
return
}
Expand Down
6 changes: 3 additions & 3 deletions internal/storage/environments/git/readonly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func TestReadOnlyEnvironment(t *testing.T) {
ref, err := env.PutNamespace(ctx, "main", ns)
assert.Empty(t, ref)
require.Error(t, err)
assert.ErrorIs(t, err, ErrReadOnly)
require.ErrorIs(t, err, ErrReadOnly)
assert.Contains(t, err.Error(), "put namespace \"test\"")
})

t.Run("DeleteNamespace returns read-only error", func(t *testing.T) {
ref, err := env.DeleteNamespace(ctx, "main", "test")
assert.Empty(t, ref)
require.Error(t, err)
assert.ErrorIs(t, err, ErrReadOnly)
require.ErrorIs(t, err, ErrReadOnly)
assert.Contains(t, err.Error(), "delete namespace \"test\"")
})

Expand All @@ -43,7 +43,7 @@ func TestReadOnlyEnvironment(t *testing.T) {
})
assert.Empty(t, ref)
require.Error(t, err)
assert.ErrorIs(t, err, ErrReadOnly)
require.ErrorIs(t, err, ErrReadOnly)
assert.Contains(t, err.Error(), "update resource type \"test.Flag\"")
})
}
8 changes: 4 additions & 4 deletions internal/storage/environments/osfs/osfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ func TestFilesystem_Operations(t *testing.T) {
t.Run("error cases", func(t *testing.T) {
// Test opening non-existent file
_, err := fs.Open("nonexistent.txt")
assert.Error(t, err)
require.Error(t, err)

// Test stat on non-existent file
_, err = fs.Stat("nonexistent.txt")
assert.Error(t, err)
require.Error(t, err)

// Test reading non-existent directory
_, err = fs.ReadDir("nonexistentdir")
assert.Error(t, err)
require.Error(t, err)

// Test removing non-existent file
err = fs.Remove("nonexistent.txt")
assert.Error(t, err)
require.Error(t, err)
})
}

Expand Down

0 comments on commit 374300a

Please sign in to comment.