Skip to content

Commit

Permalink
Merge pull request #142 from yandex/arcadia
Browse files Browse the repository at this point in the history
go 1.17 support
  • Loading branch information
ligreen authored Oct 28, 2021
2 parents 8a3962c + 8eccb04 commit 754904e
Show file tree
Hide file tree
Showing 25 changed files with 196 additions and 59 deletions.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/yandex/pandora/lib/zaputil"
)

const Version = "0.3.3"
const Version = "0.3.4"
const defaultConfigFile = "load"
const stdinConfigSelector = "-"

Expand Down
2 changes: 1 addition & 1 deletion components/example/import/import_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package example
import (
"testing"

"github.com/yandex/pandora/lib/ginkgoutil"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/yandex/pandora/lib/ginkgoutil"
)

func TestImport(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion components/phttp/ammo/simple/jsonline/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"

"github.com/yandex/pandora/components/phttp/ammo/simple"
"github.com/spf13/afero"
"github.com/yandex/pandora/components/phttp/ammo/simple"
)

func NewProvider(fs afero.Fs, conf Config) *Provider {
Expand Down
2 changes: 1 addition & 1 deletion components/phttp/ammo/simple/uri/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
. "github.com/onsi/gomega/gstruct"
"github.com/spf13/afero"

"github.com/pkg/errors"
"github.com/yandex/pandora/components/phttp/ammo/simple"
"github.com/yandex/pandora/core"
"github.com/pkg/errors"
)

const testFile = "./ammo.uri"
Expand Down
8 changes: 7 additions & 1 deletion components/phttp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"crypto/tls"
"net"
"net/http"
"strings"
"time"

"github.com/pkg/errors"
"go.uber.org/zap"
"golang.org/x/net/http2"

"github.com/yandex/pandora/core/config"
"github.com/yandex/pandora/lib/netutil"
"github.com/pkg/errors"
)

//go:generate mockery -name=Client -case=underscore -inpkg -testonly
Expand Down Expand Up @@ -145,6 +146,11 @@ const notHTTP2PanicMsg = "Non HTTP/2 connection established. Seems that target d
func (c *panicOnHTTP1Client) Do(req *http.Request) (*http.Response, error) {
res, err := c.Client.Do(req)
if err != nil {
var opError *net.OpError
// Unfortunately, Go doesn't expose tls.alert (https://github.com/golang/go/issues/35234), so we make decisions based on the error message
if errors.As(err, &opError) && opError.Op == "remote error" && strings.Contains(err.Error(), "no application protocol") {
zap.L().Panic(notHTTP2PanicMsg, zap.Error(err))
}
return nil, err
}
err = checkHTTP2(res.TLS)
Expand Down
2 changes: 1 addition & 1 deletion components/phttp/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"net/http/httputil"
"net/url"

"github.com/yandex/pandora/lib/netutil"
"github.com/pkg/errors"
"github.com/yandex/pandora/lib/netutil"
)

type ConnectGunConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion components/phttp/mocks/ammo.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/aggregator/jsonlines.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"bufio"
"io"

"github.com/yandex/pandora/lib/ioutil2"
jsoniter "github.com/json-iterator/go"
"github.com/yandex/pandora/lib/ioutil2"

"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/config"
Expand Down
2 changes: 1 addition & 1 deletion core/aggregator/mocks/sample_encoder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/aggregator/netsample/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func TestCustomSets(t *testing.T) {
tag,
int(userDuration.Nanoseconds()/1000), // keyRTTMicro
int(latency.Nanoseconds()/1000), // keyLatencyMicro
reqBytes, // keyRequestBytes
respBytes, // keyResponseBytes
reqBytes, // keyRequestBytes
respBytes, // keyResponseBytes
110,
0,
)
Expand Down
2 changes: 1 addition & 1 deletion core/coretest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
package coretest

import (
"github.com/onsi/gomega"
"github.com/yandex/pandora/core/config"
"github.com/yandex/pandora/lib/ginkgoutil"
"github.com/onsi/gomega"
)

func Decode(data string, result interface{}) {
Expand Down
2 changes: 1 addition & 1 deletion core/coretest/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package coretest
import (
"time"

"github.com/yandex/pandora/core"
"github.com/onsi/gomega"
"github.com/yandex/pandora/core"
)

func ExpectScheduleNextsStartAt(sched core.Schedule, startAt time.Time, nexts ...time.Duration) {
Expand Down
2 changes: 1 addition & 1 deletion core/datasource/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os"
"testing"

"github.com/yandex/pandora/core/coretest"
"github.com/spf13/afero"
"github.com/yandex/pandora/core/coretest"
)

func TestFileSource(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions core/engine/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ var _ = Describe("Instance", func() {
BeforeEach(func() {
ctx, _ = context.WithTimeout(context.Background(), 10*time.Millisecond)
sched := sched.(*coremock.Schedule)
sched.On("Next").Return(time.Now().Add(5*time.Second), true)
sched.On("Left").Return(1)
gun.On("Bind", aggregator, mock.Anything).Return(nil)
provider.On("Acquire").Return(struct{}{}, true)
sched.On("Next").Return(time.Now().Add(5*time.Second), true)
sched.On("Left").Return(1)
gun.On("Bind", aggregator, mock.Anything).Return(nil)
provider.On("Acquire").Return(struct{}{}, true)
})
It("start fail", func() {
err := ins.Run(ctx)
Expand Down
2 changes: 1 addition & 1 deletion core/mocks/aggregator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/mocks/gun.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/mocks/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/plugin/pluginconfig/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"strings"
"testing"

"github.com/yandex/pandora/core/config"
"github.com/yandex/pandora/core/plugin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/yandex/pandora/core/config"
"github.com/yandex/pandora/core/plugin"
)

func init() {
Expand Down
49 changes: 28 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
module github.com/yandex/pandora

go 1.15
go 1.17

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20171111151018-521b25f4b05f
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4
github.com/fatih/structs v1.0.0
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-playground/locales v0.11.2 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect
github.com/jhump/protoreflect v1.10.1
github.com/json-iterator/go v0.0.0-20180214060632-e7c7f3b33712
github.com/kr/pretty v0.1.0 // indirect
github.com/magiconair/properties v1.7.6
github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047
github.com/onsi/ginkgo v1.4.0
github.com/onsi/gomega v1.3.0
github.com/pelletier/go-toml v1.1.0 // indirect
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pkg/errors v0.9.0
github.com/pquerna/ffjson v0.0.0-20171002144729-d49c2bc1aa13
github.com/spf13/afero v1.0.2
github.com/spf13/viper v1.0.0
github.com/stretchr/testify v1.7.0
go.uber.org/atomic v1.3.1
go.uber.org/zap v1.7.1
golang.org/x/net v0.0.0-20200822124328-c89045814202
google.golang.org/grpc v1.41.0
gopkg.in/bluesuncorp/validator.v9 v9.10.0
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/go-playground/locales v0.11.2 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect
github.com/pelletier/go-toml v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/cast v1.2.0 // indirect
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect
github.com/spf13/pflag v1.0.0 // indirect
github.com/spf13/viper v1.0.0
github.com/stretchr/objx v0.1.0 // indirect
github.com/stretchr/testify v1.2.1
go.uber.org/atomic v1.3.1
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.7.1
golang.org/x/net v0.0.0-20190311183353-d8887717615a
gopkg.in/bluesuncorp/validator.v9 v9.10.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect
golang.org/x/text v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/yaml.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.2.3 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
Loading

0 comments on commit 754904e

Please sign in to comment.