Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: drop gotest.tools assertion and add linting rule #42566

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ linters-settings:
- errors
- fmt
reason: "This package is deprecated, use `fmt.Errorf` with `%w` instead"
- gotest.tools/v3:
recommendations:
- github.com/stretchr/testify
reason: "Use one assertion library consistently across the codebase"
- github.com/google/uuid:
# Recommended modules that should be used instead. (Optional)
recommendations:
Expand Down
46 changes: 23 additions & 23 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28552,29 +28552,6 @@ Contents of probable licence file $GOMODCACHE/gotest.tools/[email protected]/LICE
limitations under the License.


--------------------------------------------------------------------------------
Dependency : gotest.tools/v3
Version: v3.5.1
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/gotest.tools/[email protected]/LICENSE:

Copyright 2018 gotest.tools authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


--------------------------------------------------------------------------------
Dependency : howett.net/plist
Version: v1.0.1
Expand Down Expand Up @@ -73800,6 +73777,29 @@ See the License for the specific language governing permissions and
limitations under the License.


--------------------------------------------------------------------------------
Dependency : gotest.tools/v3
Version: v3.5.1
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/gotest.tools/[email protected]/LICENSE:

Copyright 2018 gotest.tools authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


--------------------------------------------------------------------------------
Dependency : k8s.io/klog/v2
Version: v2.130.1
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ require (
golang.org/x/term v0.27.0
google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gotest.tools/v3 v3.5.1
)

require (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/confmap"
"gopkg.in/yaml.v2"
"gotest.tools/v3/assert"

"github.com/elastic/elastic-agent-libs/config"
)
Expand Down Expand Up @@ -72,7 +72,7 @@ timeout: 1m30s
user: elastic
headers:
X-Header-1: foo
X-Bar-Header: bar
X-Bar-Header: bar
batcher:
enabled: true
max_size_items: 1600
Expand Down Expand Up @@ -106,11 +106,11 @@ retry:
enabled: true
initial_interval: 1s
max_interval: 1m0s
max_retries: 3
logs_index: some-index
max_retries: 3
logs_index: some-index
password: changeme
user: elastic
timeout: 1m30s
user: elastic
timeout: 1m30s
`

tests := []struct {
Expand Down Expand Up @@ -147,11 +147,11 @@ retry:
enabled: true
initial_interval: 5s
max_interval: 5m0s
max_retries: 3
logs_index: some-index
max_retries: 3
logs_index: some-index
password: changeme
user: elastic
timeout: 1m30s
user: elastic
timeout: 1m30s
idle_conn_timeout: 1s
num_workers: 1
batcher:
Expand Down
Loading