diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51502a1f35..6071fdc69e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,21 +188,19 @@ jobs: go run .github/check-license.go bin/go-sumtype ./... # use GITHUB_TOKEN because only it has access to GitHub Checks API - bin/golangci-lint run -c=.golangci-required.yml --out-format=line-number | bin/reviewdog -f=golangci-lint -name='Required checks' -reporter=github-pr-check + bin/golangci-lint run -c=.golangci-required.yml --out-format=line-number | bin/reviewdog -f=golangci-lint -reporter=github-pr-review -fail-on-error=true - # run it like that until some of those issues/PRs are resolved: - # * https://github.com/quasilyte/go-consistent/issues/33 + # run it like this until it will be added to golangci-lint: # * https://github.com/golangci/golangci-lint/issues/288 - # * https://github.com/reviewdog/errorformat/pull/47 (once it is atually used by reviewdog) - bin/go-consistent -pedantic -exclude "tests" ./... | bin/reviewdog -f=go-consistent -name='Required go-consistent checks' -reporter=github-pr-check + bin/go-consistent -pedantic -exclude "tests" ./... | bin/reviewdog -f=go-consistent -reporter=github-pr-review -fail-on-error=true - name: Run optional checks/linters run: | # use ROBOT_TOKEN for better reviewer's name if [[ ! -z "${{ secrets.ROBOT_TOKEN }}" ]]; then - bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.ROBOT_TOKEN }} bin/reviewdog -f=golangci-lint -name='Linters' -reporter=github-pr-review + bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.ROBOT_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review else - bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -name='Linters' -reporter=github-pr-review + bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review fi - name: Check that there are no source code changes diff --git a/services/victoriametrics/victoriametrics_test.go b/services/victoriametrics/victoriametrics_test.go index 7201362e2d..be5a75354a 100644 --- a/services/victoriametrics/victoriametrics_test.go +++ b/services/victoriametrics/victoriametrics_test.go @@ -26,11 +26,14 @@ import ( "github.com/AlekSi/pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/postgresql" "github.com/percona/pmm-managed/models" "github.com/percona/pmm-managed/utils/testdb" + "github.com/percona/pmm-managed/utils/tests" ) const configPath = "../../testdata/victoriametrics/promscrape.yml" @@ -755,19 +758,20 @@ scrape_configs: assert.Errorf(t, err, "error when checking Prometheus config") }) - t.Run("Good scrape config file with unsupported params", func(t *testing.T) { + t.Run("Scrape config file with unknown params", func(t *testing.T) { err := svc.configAndReload(context.TODO(), []byte(strings.TrimSpace(` # Managed by pmm-managed. DO NOT EDIT. --- global: scrape_interval: 1m scrape_timeout: 54s -remote_write: -- url: http://some-remote-url -remote_read: -- url: http://some-remote-read-url +unknown_filed: unknown_value + `))) - assert.NoError(t, err) + tests.AssertGRPCError(t, status.New(codes.Aborted, + "yaml: unmarshal errors:\n line 6: field unknown_filed not found in type promscrape.Config;"+ + " pass -promscrape.config.strictParse=false command-line flag for ignoring unknown fields in yaml config\n", + ), err) }) }