Skip to content

Commit

Permalink
feat: collector 单测调整 --story=119054819 (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Aug 6, 2024
1 parent d975f20 commit 2b45548
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/collector/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ bk-collector
logs/
data/
coverage.out
coverage.tmp
build/
3 changes: 2 additions & 1 deletion pkg/collector/control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ MODULE=bk-collector
TEST_COVERAGE_THRESHOLD=75

function unittest() {
go test ./... -coverprofile coverage.out -covermode count
go test ./... -coverprofile coverage.tmp -covermode count
cat coverage.tmp | grep -v '/gen/' > coverage.out
go tool cover -func coverage.out
echo "Quality Gate: checking test coverage is above threshold ..."
echo "Threshold : $TEST_COVERAGE_THRESHOLD%"
Expand Down
3 changes: 1 addition & 2 deletions pkg/collector/receiver/pyroscope/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ import (
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/collector/internal/utils"
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/collector/pipeline"
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/collector/receiver"
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/utils/logger"

pushv1 "github.com/TencentBlueKing/bkmonitor-datalink/pkg/collector/receiver/pyroscope/gen/proto/go/push/v1"
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/collector/receiver/pyroscope/gen/proto/go/push/v1/pushv1connect"
"github.com/TencentBlueKing/bkmonitor-datalink/pkg/utils/logger"
)

const (
Expand Down

0 comments on commit 2b45548

Please sign in to comment.