Skip to content

Commit

Permalink
[receiver/mongodb] Enable linter and fix issues (#11798)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Jun 29, 2022
1 parent 7871997 commit ce857ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions receiver/mongodbreceiver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// nolint:gocritic
package mongodbreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver"

import (
Expand Down Expand Up @@ -54,13 +53,13 @@ func (fc *fakeClient) GetVersion(ctx context.Context) (*version.Version, error)
return args.Get(0).(*version.Version), args.Error(1)
}

func (fc *fakeClient) ServerStatus(ctx context.Context, DBName string) (bson.M, error) {
args := fc.Called(ctx, DBName)
func (fc *fakeClient) ServerStatus(ctx context.Context, dbName string) (bson.M, error) {
args := fc.Called(ctx, dbName)
return args.Get(0).(bson.M), args.Error(1)
}

func (fc *fakeClient) DBStats(ctx context.Context, DBName string) (bson.M, error) {
args := fc.Called(ctx, DBName)
func (fc *fakeClient) DBStats(ctx context.Context, dbName string) (bson.M, error) {
args := fc.Called(ctx, dbName)
return args.Get(0).(bson.M), args.Error(1)
}

Expand Down
3 changes: 1 addition & 2 deletions receiver/mongodbreceiver/scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// nolint:errcheck
package mongodbreceiver

import (
Expand Down Expand Up @@ -90,7 +89,7 @@ func TestScrape(t *testing.T) {
expectedMetrics, err := golden.ReadMetrics(expectedFile)
require.NoError(t, err)

scrapertest.CompareMetrics(actualMetrics, expectedMetrics)
require.NoError(t, scrapertest.CompareMetrics(actualMetrics, expectedMetrics))
}

func TestScrapeNoClient(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions receiver/mongodbreceiver/testdata/scraper/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scopeMetrics": [
{
"scope": {
"name": "otelcol/mongodb",
"name": "otelcol/mongodbreceiver",
"version": "latest"
},
"metrics": [
Expand Down Expand Up @@ -169,7 +169,7 @@
"scopeMetrics": [
{
"scope": {
"name": "otelcol/mongodb",
"name": "otelcol/mongodbreceiver",
"version": "latest"
},
"metrics": [
Expand Down

0 comments on commit ce857ae

Please sign in to comment.