parent
b9fc93eb85
commit
15b9531273
|
@ -1,5 +1,9 @@
|
|||
## unreleased
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
1. [19987](https://github.com/influxdata/influxdb/pull/19987): Fix various typos. Thanks @kumakichi!
|
||||
|
||||
## v2.0.1 [2020-11-10]
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -383,7 +383,7 @@ func TestService_handleGetAuthorization(t *testing.T) {
|
|||
t.Errorf("%q. handleGetAuthorization() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if diff, err := jsonDiff(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetAuthorization. error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetAuthorization. error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && diff != "" {
|
||||
t.Errorf("%q. handleGetAuthorization() = -got/+want %s**", tt.name, diff)
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ func TestService_handleDeleteAuthorization(t *testing.T) {
|
|||
|
||||
if tt.wants.body != "" {
|
||||
if diff, err := jsonDiff(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteAuthorization(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteAuthorization(). error unmarshalling json %v", tt.name, err)
|
||||
} else if diff != "" {
|
||||
t.Errorf("%q. handleDeleteAuthorization() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ func (l *AuthLogger) UpdateAuthorization(ctx context.Context, id influxdb.ID, up
|
|||
l.logger.Debug("failed to update authorization", zap.Error(err), dur)
|
||||
return
|
||||
}
|
||||
l.logger.Debug("authorizationauthorization update", dur)
|
||||
l.logger.Debug("authorization update", dur)
|
||||
}(time.Now())
|
||||
return l.authService.UpdateAuthorization(ctx, id, upd)
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ func (s *Service) FindAuthorizationByToken(ctx context.Context, n string) (*infl
|
|||
return a, nil
|
||||
}
|
||||
|
||||
// FindAuthorizations retrives all authorizations that match an arbitrary authorization filter.
|
||||
// FindAuthorizations retrieves all authorizations that match an arbitrary authorization filter.
|
||||
// Filters using ID, or Token should be efficient.
|
||||
// Other filters will do a linear scan across all authorizations searching for a match.
|
||||
func (s *Service) FindAuthorizations(ctx context.Context, filter influxdb.AuthorizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Authorization, int, error) {
|
||||
|
|
|
@ -15,7 +15,7 @@ type AuthorizationService struct {
|
|||
s influxdb.AuthorizationService
|
||||
}
|
||||
|
||||
// NewAuthorizationService constructs an instance of an authorizing authorization serivce.
|
||||
// NewAuthorizationService constructs an instance of an authorizing authorization service.
|
||||
func NewAuthorizationService(s influxdb.AuthorizationService) *AuthorizationService {
|
||||
return &AuthorizationService{
|
||||
s: s,
|
||||
|
|
|
@ -15,7 +15,7 @@ type BucketService struct {
|
|||
s influxdb.BucketService
|
||||
}
|
||||
|
||||
// NewBucketService constructs an instance of an authorizing bucket serivce.
|
||||
// NewBucketService constructs an instance of an authorizing bucket service.
|
||||
func NewBucketService(s influxdb.BucketService) *BucketService {
|
||||
return &BucketService{
|
||||
s: s,
|
||||
|
|
|
@ -17,7 +17,7 @@ type CheckService struct {
|
|||
influxdb.TaskService
|
||||
}
|
||||
|
||||
// NewCheckService constructs an instance of an authorizing check serivce.
|
||||
// NewCheckService constructs an instance of an authorizing check service.
|
||||
func NewCheckService(s influxdb.CheckService, urm influxdb.UserResourceMappingService, org influxdb.OrganizationService) *CheckService {
|
||||
return &CheckService{
|
||||
s: s,
|
||||
|
|
|
@ -14,7 +14,7 @@ type DashboardService struct {
|
|||
s influxdb.DashboardService
|
||||
}
|
||||
|
||||
// NewDashboardService constructs an instance of an authorizing dashboard serivce.
|
||||
// NewDashboardService constructs an instance of an authorizing dashboard service.
|
||||
func NewDashboardService(s influxdb.DashboardService) *DashboardService {
|
||||
return &DashboardService{
|
||||
s: s,
|
||||
|
|
|
@ -15,7 +15,7 @@ type LabelService struct {
|
|||
orgIDResolver OrgIDResolver
|
||||
}
|
||||
|
||||
// NewLabelServiceWithOrg constructs an instance of an authorizing label serivce.
|
||||
// NewLabelServiceWithOrg constructs an instance of an authorizing label service.
|
||||
// Replaces NewLabelService.
|
||||
func NewLabelServiceWithOrg(s influxdb.LabelService, orgIDResolver OrgIDResolver) *LabelService {
|
||||
return &LabelService{
|
||||
|
|
|
@ -16,7 +16,7 @@ type NotificationEndpointService struct {
|
|||
influxdb.OrganizationService
|
||||
}
|
||||
|
||||
// NewNotificationEndpointService constructs an instance of an authorizing notification endpoint serivce.
|
||||
// NewNotificationEndpointService constructs an instance of an authorizing notification endpoint service.
|
||||
func NewNotificationEndpointService(
|
||||
s influxdb.NotificationEndpointService,
|
||||
urm influxdb.UserResourceMappingService,
|
||||
|
|
|
@ -16,7 +16,7 @@ type NotificationRuleStore struct {
|
|||
influxdb.OrganizationService
|
||||
}
|
||||
|
||||
// NewNotificationRuleStore constructs an instance of an authorizing notification rule serivce.
|
||||
// NewNotificationRuleStore constructs an instance of an authorizing notification rule service.
|
||||
func NewNotificationRuleStore(s influxdb.NotificationRuleStore, urm influxdb.UserResourceMappingService, org influxdb.OrganizationService) *NotificationRuleStore {
|
||||
return &NotificationRuleStore{
|
||||
s: s,
|
||||
|
|
|
@ -15,7 +15,7 @@ type OrgService struct {
|
|||
s influxdb.OrganizationService
|
||||
}
|
||||
|
||||
// NewOrgService constructs an instance of an authorizing org serivce.
|
||||
// NewOrgService constructs an instance of an authorizing org service.
|
||||
func NewOrgService(s influxdb.OrganizationService) *OrgService {
|
||||
return &OrgService{
|
||||
s: s,
|
||||
|
|
|
@ -11,7 +11,7 @@ type PasswordService struct {
|
|||
next influxdb.PasswordsService
|
||||
}
|
||||
|
||||
// NewPasswordService wraps an existing password service with auth middlware.
|
||||
// NewPasswordService wraps an existing password service with auth middleware.
|
||||
func NewPasswordService(svc influxdb.PasswordsService) *PasswordService {
|
||||
return &PasswordService{next: svc}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ type ScraperTargetStoreService struct {
|
|||
s influxdb.ScraperTargetStoreService
|
||||
}
|
||||
|
||||
// NewScraperTargetStoreService constructs an instance of an authorizing scraper target store serivce.
|
||||
// NewScraperTargetStoreService constructs an instance of an authorizing scraper target store service.
|
||||
func NewScraperTargetStoreService(s influxdb.ScraperTargetStoreService,
|
||||
urm influxdb.UserResourceMappingService,
|
||||
org influxdb.OrganizationService,
|
||||
|
|
|
@ -14,7 +14,7 @@ type SecretService struct {
|
|||
s influxdb.SecretService
|
||||
}
|
||||
|
||||
// NewSecretService constructs an instance of an authorizing secret serivce.
|
||||
// NewSecretService constructs an instance of an authorizing secret service.
|
||||
func NewSecretService(s influxdb.SecretService) *SecretService {
|
||||
return &SecretService{
|
||||
s: s,
|
||||
|
|
|
@ -15,7 +15,7 @@ type TelegrafConfigService struct {
|
|||
influxdb.UserResourceMappingService
|
||||
}
|
||||
|
||||
// NewTelegrafConfigService constructs an instance of an authorizing telegraf serivce.
|
||||
// NewTelegrafConfigService constructs an instance of an authorizing telegraf service.
|
||||
func NewTelegrafConfigService(s influxdb.TelegrafConfigStore, urm influxdb.UserResourceMappingService) *TelegrafConfigService {
|
||||
return &TelegrafConfigService{
|
||||
s: s,
|
||||
|
|
|
@ -14,7 +14,7 @@ type UserService struct {
|
|||
s influxdb.UserService
|
||||
}
|
||||
|
||||
// NewUserService constructs an instance of an authorizing user serivce.
|
||||
// NewUserService constructs an instance of an authorizing user service.
|
||||
func NewUserService(s influxdb.UserService) *UserService {
|
||||
return &UserService{
|
||||
s: s,
|
||||
|
|
|
@ -131,7 +131,7 @@ func (s *Service) findCheckByName(ctx context.Context, tx kv.Tx, orgID influxdb.
|
|||
return chVal.(influxdb.Check), nil
|
||||
}
|
||||
|
||||
// FindCheck retrives a check using an arbitrary check filter.
|
||||
// FindCheck retrieves a check using an arbitrary check filter.
|
||||
// Filters using ID, or OrganizationID and check Name should be efficient.
|
||||
// Other filters will do a linear scan across checks until it finds a match.
|
||||
func (s *Service) FindCheck(ctx context.Context, filter influxdb.CheckFilter) (influxdb.Check, error) {
|
||||
|
|
|
@ -41,7 +41,7 @@ func TestData(t *testing.T) {
|
|||
q := chronograf.QueryConfig{}
|
||||
err := json.Unmarshal([]byte(config), &q)
|
||||
if err != nil {
|
||||
t.Errorf("Error unmarshaling %v", err)
|
||||
t.Errorf("Error unmarshalling %v", err)
|
||||
}
|
||||
alert := chronograf.AlertRule{
|
||||
Trigger: "deadman",
|
||||
|
|
|
@ -35,7 +35,7 @@ var up = func(db *bolt.DB) error {
|
|||
|
||||
err := proto.Unmarshal(data, board)
|
||||
if err != nil {
|
||||
log.Fatal("unmarshaling error: ", err)
|
||||
log.Fatal("unmarshalling error: ", err)
|
||||
}
|
||||
|
||||
// Migrate the dashboard
|
||||
|
@ -77,7 +77,7 @@ var down = func(db *bolt.DB) error {
|
|||
This isolates the migration from the codebase, and prevents a future change
|
||||
to a type definition from invalidating the migration functions.
|
||||
*/
|
||||
var dashboardBucket = []byte("Dashoard")
|
||||
var dashboardBucket = []byte("Dashoard") // N.B. leave the misspelling for backwards-compat!
|
||||
|
||||
type Source struct {
|
||||
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
var _ chronograf.DashboardsStore = &DashboardsStore{}
|
||||
|
||||
// DashboardsBucket is the bolt bucket dashboards are stored in
|
||||
var DashboardsBucket = []byte("Dashoard")
|
||||
var DashboardsBucket = []byte("Dashoard") // N.B. leave the misspelling for backwards-compat!
|
||||
|
||||
// DashboardsStore is the bolt implementation of storing dashboards
|
||||
type DashboardsStore struct {
|
||||
|
|
|
@ -207,7 +207,7 @@ func Test_MarshalDashboard(t *testing.T) {
|
|||
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
|
||||
t.Fatal("Error marshaling dashboard: err", err)
|
||||
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
|
||||
t.Fatal("Error unmarshaling dashboard: err:", err)
|
||||
t.Fatal("Error unmarshalling dashboard: err:", err)
|
||||
} else if !cmp.Equal(dashboard, actual) {
|
||||
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(dashboard, actual))
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) {
|
|||
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
|
||||
t.Fatal("Error marshaling dashboard: err", err)
|
||||
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
|
||||
t.Fatal("Error unmarshaling dashboard: err:", err)
|
||||
t.Fatal("Error unmarshalling dashboard: err:", err)
|
||||
} else if !cmp.Equal(expected, actual) {
|
||||
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) {
|
|||
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
|
||||
t.Fatal("Error marshaling dashboard: err", err)
|
||||
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
|
||||
t.Fatal("Error unmarshaling dashboard: err:", err)
|
||||
t.Fatal("Error unmarshalling dashboard: err:", err)
|
||||
} else if !cmp.Equal(expected, actual) {
|
||||
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ func Test_MarshalDashboard_WithEmptyCellType(t *testing.T) {
|
|||
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
|
||||
t.Fatal("Error marshaling dashboard: err", err)
|
||||
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
|
||||
t.Fatal("Error unmarshaling dashboard: err:", err)
|
||||
t.Fatal("Error unmarshalling dashboard: err:", err)
|
||||
} else if !cmp.Equal(expected, actual) {
|
||||
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ func (s *SourcesStore) get(ctx context.Context, id int, tx *bolt.Tx) (chronograf
|
|||
}
|
||||
|
||||
func (s *SourcesStore) update(ctx context.Context, src chronograf.Source, tx *bolt.Tx) error {
|
||||
// Get an existing soource with the same ID.
|
||||
// Get an existing source with the same ID.
|
||||
b := tx.Bucket(SourcesBucket)
|
||||
if v := b.Get(itob(src.ID)); v == nil {
|
||||
return chronograf.ErrSourceNotFound
|
||||
|
|
|
@ -741,7 +741,7 @@ type OrganizationQuery struct {
|
|||
//
|
||||
// While not necessary for the app to function correctly, it is
|
||||
// expected that Implementors of the OrganizationsStore will take
|
||||
// care to guarantee that the Organization.Name is unqiue. Allowing
|
||||
// care to guarantee that the Organization.Name is unique. Allowing
|
||||
// for duplicate names creates a confusing UX experience for the User.
|
||||
type OrganizationsStore interface {
|
||||
// Add creates a new Organization.
|
||||
|
|
|
@ -62,7 +62,7 @@ Older chronograf dashboards had the following features:
|
|||
* View Dashboard
|
||||
* Add new visualization to dashboard
|
||||
* Add existing visualization to dashboard
|
||||
* Remove visualizatoin from dashboard
|
||||
* Remove visualization from dashboard
|
||||
* Naming of dashboards
|
||||
* Delete dashboard
|
||||
* Edit visualization in dashboard
|
||||
|
|
|
@ -127,7 +127,7 @@ func Test_Enterprise_NewClientWithURL(t *testing.T) {
|
|||
url: "http://localhost:8086",
|
||||
},
|
||||
{
|
||||
name: "tls sholuld have no error",
|
||||
name: "tls should have no error",
|
||||
url: "https://localhost:8086",
|
||||
},
|
||||
{
|
||||
|
@ -192,11 +192,11 @@ func Test_Enterprise_ComplainsIfNotOpened(t *testing.T) {
|
|||
},
|
||||
false, false, chronograf.TimeSeries(m1))
|
||||
if err != nil {
|
||||
t.Error("Expected ErrUnitialized, but was this err:", err)
|
||||
t.Error("Expected nil, but was this err:", err)
|
||||
}
|
||||
_, err = cl.Query(context.Background(), chronograf.Query{Command: "show shards", DB: "_internal", RP: "autogen"})
|
||||
if err != chronograf.ErrUninitialized {
|
||||
t.Error("Expected ErrUnitialized, but was this err:", err)
|
||||
t.Error("Expected ErrUninitialized, but was this err:", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ var _ chronograf.DashboardsStore = &Dashboards{}
|
|||
// Dashboards are JSON dashboards stored in the filesystem
|
||||
type Dashboards struct {
|
||||
Dir string // Dir is the directory containing the dashboards.
|
||||
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
|
||||
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
|
||||
Create func(string, interface{}) error // Create will write dashboard to file.
|
||||
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
|
||||
Remove func(name string) error // Remove file
|
||||
|
|
|
@ -19,7 +19,7 @@ var _ chronograf.ServersStore = &Kapacitors{}
|
|||
// Kapacitors are JSON kapacitors stored in the filesystem
|
||||
type Kapacitors struct {
|
||||
Dir string // Dir is the directory containing the kapacitors.
|
||||
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
|
||||
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
|
||||
Create func(string, interface{}) error // Create will write kapacitor to file.
|
||||
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
|
||||
Remove func(name string) error // Remove file
|
||||
|
|
|
@ -19,7 +19,7 @@ var _ chronograf.SourcesStore = &Sources{}
|
|||
// Sources are JSON sources stored in the filesystem
|
||||
type Sources struct {
|
||||
Dir string // Dir is the directory containing the sources.
|
||||
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
|
||||
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
|
||||
Create func(string, interface{}) error // Create will write source to file.
|
||||
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
|
||||
Remove func(name string) error // Remove file
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/influxdata/influxql"
|
||||
)
|
||||
|
||||
// TimeRangeAsEpochNano extracs the min and max epoch times from the expression
|
||||
// TimeRangeAsEpochNano extracts the min and max epoch times from the expression
|
||||
func TimeRangeAsEpochNano(expr influxql.Expr, now time.Time) (min, max int64, err error) {
|
||||
// TODO(desa): is this OK?
|
||||
_, trange, err := influxql.ConditionExpr(expr, nil)
|
||||
|
|
|
@ -9,7 +9,7 @@ type AlertNodes struct {
|
|||
Posts []*Post `json:"post"` // HTTPPost will post the JSON alert data to the specified URLs.
|
||||
TCPs []*TCP `json:"tcp"` // TCP will send the JSON alert data to the specified endpoint via TCP.
|
||||
Email []*Email `json:"email"` // Email will send alert data to the specified emails.
|
||||
Exec []*Exec `json:"exec"` // Exec will run shell commandss when an alert triggers
|
||||
Exec []*Exec `json:"exec"` // Exec will run shell commands when an alert triggers
|
||||
Log []*Log `json:"log"` // Log will log JSON alert data to files in JSON lines format.
|
||||
VictorOps []*VictorOps `json:"victorOps"` // VictorOps will send alert to all VictorOps
|
||||
PagerDuty []*PagerDuty `json:"pagerDuty"` // PagerDuty will send alert to all PagerDuty
|
||||
|
|
|
@ -28,7 +28,7 @@ func (store *SourcesStore) All(ctx context.Context) ([]chronograf.Source, error)
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
// Delete removes the SourcesStore.Soruce if it matches the provided Source
|
||||
// Delete removes the SourcesStore.Source if it matches the provided Source
|
||||
func (store *SourcesStore) Delete(ctx context.Context, src chronograf.Source) error {
|
||||
if store.Source == nil || store.Source.ID != src.ID {
|
||||
return fmt.Errorf("unable to find Source with id %d", src.ID)
|
||||
|
|
|
@ -47,7 +47,7 @@ func TestGenericGroup_withNotEmail(t *testing.T) {
|
|||
|
||||
got, err := prov.Group(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
want := "pinheads.rok"
|
||||
|
@ -93,7 +93,7 @@ func TestGenericGroup_withEmail(t *testing.T) {
|
|||
|
||||
got, err := prov.Group(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
want := "pinheads.rok"
|
||||
|
@ -139,7 +139,7 @@ func TestGenericPrincipalID(t *testing.T) {
|
|||
|
||||
got, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
want := "martymcfly@pinheads.rok"
|
||||
|
@ -191,7 +191,7 @@ func TestGenericPrincipalIDDomain(t *testing.T) {
|
|||
|
||||
got, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
want := "martymcfly@pinheads.rok"
|
||||
if got != want {
|
||||
|
|
|
@ -49,7 +49,7 @@ func TestGithubPrincipalID(t *testing.T) {
|
|||
|
||||
email, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
if got, want := email, "martymcfly@example.com"; got != want {
|
||||
|
@ -106,7 +106,7 @@ func TestGithubPrincipalIDOrganization(t *testing.T) {
|
|||
|
||||
email, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
if email != expectedUser[0].Email {
|
||||
|
|
|
@ -75,7 +75,7 @@ func (g *Google) PrincipalID(provider *http.Client) (string, error) {
|
|||
g.Logger.Error("Unable to retrieve Google email ", err.Error())
|
||||
return "", err
|
||||
}
|
||||
// No domain filtering required, so, the user is autenticated.
|
||||
// No domain filtering required, so, the user is authenticated.
|
||||
if len(g.Domains) == 0 {
|
||||
return info.Email, nil
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func TestGooglePrincipalID(t *testing.T) {
|
|||
|
||||
email, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
if email != expected.Email {
|
||||
|
@ -91,7 +91,7 @@ func TestGooglePrincipalIDDomain(t *testing.T) {
|
|||
|
||||
email, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
if email != expectedUser.Email {
|
||||
|
|
|
@ -46,7 +46,7 @@ func Test_Heroku_PrincipalID_ExtractsEmailAddress(t *testing.T) {
|
|||
|
||||
email, err := prov.PrincipalID(tc)
|
||||
if err != nil {
|
||||
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
|
||||
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
|
||||
}
|
||||
|
||||
if email != expected.Email {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
// NOTE:
|
||||
// This code is currently unused. however, it has been left in place because we aniticipate
|
||||
// This code is currently unused. however, it has been left in place because we anticipate
|
||||
// that it may be used in the future. It was originally developed as a misunderstanding of
|
||||
// https://github.com/influxdata/influxdb/chronograf/issues/1915
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ func Test_Service_DashboardCells(t *testing.T) {
|
|||
}
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&respFrame); err != nil {
|
||||
t.Fatalf("%q - Error unmarshaling response body: err: %s", test.name, err)
|
||||
t.Fatalf("%q - Error unmarshalling response body: err: %s", test.name, err)
|
||||
}
|
||||
|
||||
// extract actual
|
||||
|
|
|
@ -10,7 +10,7 @@ type serverContextKey string
|
|||
// server is making the requet via context
|
||||
const ServerContextKey = serverContextKey("server")
|
||||
|
||||
// hasServerContext speficies if the context contains
|
||||
// hasServerContext specifies if the context contains
|
||||
// the ServerContextKey and that the value stored there is true
|
||||
func hasServerContext(ctx context.Context) bool {
|
||||
// prevents panic in case of nil context
|
||||
|
|
|
@ -174,7 +174,7 @@ func Test_Layouts(t *testing.T) {
|
|||
// decode resp into respFrame
|
||||
resp := rr.Result()
|
||||
if err := json.NewDecoder(resp.Body).Decode(&respFrame); err != nil {
|
||||
t.Fatalf("%q - Error unmarshaling JSON: err: %s", test.name, err.Error())
|
||||
t.Fatalf("%q - Error unmarshalling JSON: err: %s", test.name, err.Error())
|
||||
}
|
||||
|
||||
// compare actual and expected
|
||||
|
|
|
@ -137,7 +137,7 @@ func newMappingsResponse(ms []chronograf.Mapping) *mappingsResponse {
|
|||
}
|
||||
}
|
||||
|
||||
// Mappings retrives all mappings
|
||||
// Mappings retrieves all mappings
|
||||
func (s *Service) Mappings(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ func (s *Service) ReplaceOrganizationLogViewerConfig(w http.ResponseWriter, r *h
|
|||
|
||||
// validLogViewerConfig ensures that the request body log viewer UI config is valid
|
||||
// to be valid, it must: not be empty, have at least one column, not have multiple
|
||||
// columns with the same name or position value, each column must have a visbility
|
||||
// columns with the same name or position value, each column must have a visibility
|
||||
// of either "visible" or "hidden" and if a column is of type severity, it must have
|
||||
// at least one severity format of type icon, text, or both
|
||||
func validLogViewerConfig(c chronograf.LogViewerConfig) error {
|
||||
|
|
|
@ -38,7 +38,7 @@ type getRoutesResponse struct {
|
|||
Mappings string `json:"mappings"` // Location of the application mappings endpoint
|
||||
Sources string `json:"sources"` // Location of the sources endpoint
|
||||
Me string `json:"me"` // Location of the me endpoint
|
||||
Environment string `json:"environment"` // Location of the environement endpoint
|
||||
Environment string `json:"environment"` // Location of the environment endpoint
|
||||
Dashboards string `json:"dashboards"` // Location of the dashboards endpoint
|
||||
Config getConfigLinksResponse `json:"config"` // Location of the config endpoint and its various sections
|
||||
Cells string `json:"cells"` // Location of the v2 cells
|
||||
|
|
|
@ -52,7 +52,7 @@ type userContextKey string
|
|||
// UserContextKey is the context key for retrieving the user off of context
|
||||
const UserContextKey = userContextKey("user")
|
||||
|
||||
// hasUserContext speficies if the context contains
|
||||
// hasUserContext specifies if the context contains
|
||||
// the UserContextKey and that the value stored there is chronograf.User
|
||||
func hasUserContext(ctx context.Context) (*chronograf.User, bool) {
|
||||
// prevents panic in case of nil context
|
||||
|
@ -70,7 +70,7 @@ func hasUserContext(ctx context.Context) (*chronograf.User, bool) {
|
|||
return u, true
|
||||
}
|
||||
|
||||
// hasSuperAdminContext speficies if the context contains
|
||||
// hasSuperAdminContext specifies if the context contains
|
||||
// the UserContextKey user is a super admin
|
||||
func hasSuperAdminContext(ctx context.Context) bool {
|
||||
u, ok := hasUserContext(ctx)
|
||||
|
@ -146,7 +146,7 @@ func (s *Store) Layouts(ctx context.Context) chronograf.LayoutsStore {
|
|||
// is returned.
|
||||
// If there is an organization specified on context, then an organizations.UsersStore
|
||||
// is returned.
|
||||
// If niether are specified, a noop.UsersStore is returned.
|
||||
// If neither are specified, a noop.UsersStore is returned.
|
||||
func (s *Store) Users(ctx context.Context) chronograf.UsersStore {
|
||||
if isServer := hasServerContext(ctx); isServer {
|
||||
return s.UsersStore
|
||||
|
@ -256,7 +256,7 @@ func (s *DirectStore) Layouts(ctx context.Context) chronograf.LayoutsStore {
|
|||
// is returned.
|
||||
// If there is an organization specified on context, then an organizations.UsersStore
|
||||
// is returned.
|
||||
// If niether are specified, a noop.UsersStore is returned.
|
||||
// If neither are specified, a noop.UsersStore is returned.
|
||||
func (s *DirectStore) Users(ctx context.Context) chronograf.UsersStore {
|
||||
return s.UsersStore
|
||||
}
|
||||
|
|
|
@ -397,7 +397,7 @@ func ToBytesPerSecond(rateLimit string) (float64, error) {
|
|||
return 0, fmt.Errorf("invalid rate limit %q: time is out of range: %v", strVal, err)
|
||||
}
|
||||
if int64Val <= 0 {
|
||||
return 0, fmt.Errorf("invalid rate limit %q: possitive time expected but %v supplied", strVal, matches[3])
|
||||
return 0, fmt.Errorf("invalid rate limit %q: positive time expected but %v supplied", strVal, matches[3])
|
||||
}
|
||||
time = float64(int64Val)
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ func readLines(reader io.Reader) []string {
|
|||
|
||||
func createTempFile(suffix string, contents []byte) string {
|
||||
file, err := ioutil.TempFile("", "influx_writeTest*."+suffix)
|
||||
file.Close() // Close immediatelly, since we need only a file name
|
||||
file.Close() // Close immediately, since we need only a file name
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return "unknown.file"
|
||||
|
@ -454,7 +454,7 @@ func Test_fluxWriteF(t *testing.T) {
|
|||
require.Contains(t, fmt.Sprintf("%s", err), "org-id")
|
||||
})
|
||||
|
||||
t.Run("validates error when failed to retrive buckets", func(t *testing.T) {
|
||||
t.Run("validates error when failed to retrieve buckets", func(t *testing.T) {
|
||||
useTestServer()
|
||||
command := cmdWrite(&globalFlags{}, genericCLIOpts{w: ioutil.Discard})
|
||||
command.SetArgs([]string{"--format", "csv", "--org", "my-org", "--bucket", "my-error-bucket"})
|
||||
|
@ -566,7 +566,7 @@ func Test_ToBytesPerSecond(t *testing.T) {
|
|||
},
|
||||
{
|
||||
in: "1B0s",
|
||||
error: `invalid rate limit "1B0s": possitive time expected but 0 supplied`,
|
||||
error: `invalid rate limit "1B0s": positive time expected but 0 supplied`,
|
||||
},
|
||||
{
|
||||
in: "1MB/42949672950s",
|
||||
|
|
|
@ -133,7 +133,7 @@ func TestLauncher_SetupWithUsers(t *testing.T) {
|
|||
}{}
|
||||
err = json.Unmarshal(body, &exp)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error unmarshaling user: %v", err)
|
||||
t.Fatalf("unexpected error unmarshalling user: %v", err)
|
||||
}
|
||||
if len(exp.Users) != 2 {
|
||||
t.Fatalf("unexpected 2 users: %#+v", exp)
|
||||
|
|
|
@ -167,7 +167,7 @@ func filterDashboardsFn(filter influxdb.DashboardFilter) func(d *influxdb.Dashbo
|
|||
}
|
||||
}
|
||||
|
||||
// FindDashboards retrives all dashboards that match an arbitrary dashboard filter.
|
||||
// FindDashboards retrieves all dashboards that match an arbitrary dashboard filter.
|
||||
func (s *Service) FindDashboards(ctx context.Context, filter influxdb.DashboardFilter, opts influxdb.FindOptions) ([]*influxdb.Dashboard, int, error) {
|
||||
ds := []*influxdb.Dashboard{}
|
||||
if len(filter.IDs) == 1 {
|
||||
|
|
|
@ -387,7 +387,7 @@ func TestService_handleGetDashboards(t *testing.T) {
|
|||
t.Errorf("%q. handleGetDashboards() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetDashboards(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetDashboards(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetDashboards() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -816,7 +816,7 @@ func TestService_handleGetDashboard(t *testing.T) {
|
|||
t.Errorf("%q. handleGetDashboard() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); tt.wants.body != "" && err != nil {
|
||||
t.Errorf("%q, handleGetDashboard(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetDashboard(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetDashboard() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1080,7 +1080,7 @@ func TestService_handlePostDashboard(t *testing.T) {
|
|||
t.Errorf("%q. handlePostDashboard() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostDashboard(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostDashboard(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostDashboard() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1180,7 +1180,7 @@ func TestService_handleDeleteDashboard(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteDashboard(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteDashboard(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteDashboard() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1371,7 +1371,7 @@ func TestService_handlePatchDashboard(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchDashboard(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchDashboard(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchDashboard() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1542,7 +1542,7 @@ func TestService_handlePostDashboardCell(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(tt.wants.body, string(body)); err != nil {
|
||||
t.Errorf("%q, handlePostDashboardCell(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostDashboardCell(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostDashboardCell() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1624,7 +1624,7 @@ func TestService_handleDeleteDashboardCell(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteDashboardCell(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteDashboardCell(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteDashboardCell() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1752,7 +1752,7 @@ func TestService_handlePatchDashboardCell(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchDashboardCell(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchDashboardCell(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchDashboardCell() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ npm test -- headless=true activeConf=nightly -t "@feature-signin"
|
|||
|
||||
**Environment Variable Overrides**
|
||||
|
||||
Configuration properties can be overridden by `E2E` environment variables. The basic pattern for exporting an enviornment variable to be picked up for test configuration is the token `E2E` followed by an underscore, then the path to the property to be modified as defined by the configuration tree in `e2e.conf.json`. Each node in the tree is declared in uppercase and separated by an underscore.
|
||||
Configuration properties can be overridden by `E2E` environment variables. The basic pattern for exporting an environment variable to be picked up for test configuration is the token `E2E` followed by an underscore, then the path to the property to be modified as defined by the configuration tree in `e2e.conf.json`. Each node in the tree is declared in uppercase and separated by an underscore.
|
||||
|
||||
For example, to declare the `influx_url` property in the `development` configuration export the environment variable `E2E_DEVELOPMENT_INFLUX_URL`.
|
||||
|
||||
|
@ -149,9 +149,9 @@ caps.set('enableVideo', true);
|
|||
|
||||
Then rerun the script `selenoid.sh` with the argument `-debug`.
|
||||
|
||||
### Light Weight Perfomance checks
|
||||
### Light Weight Performance checks
|
||||
|
||||
For tests against the cloud a light weigh perfomance utility has been added. It currently exports only one method for tests: `execTimed( func, maxDelay, failMsg, successMsg)`. This method will execute the passed function and expect it to resolve by `maxDelay` milliseconds. Failures are thrown to cucumber and results are stored in a performance log buffer. This log is then dumped to the console after all tests have been run. They are also written to a CSV report file: `./report/performance.csv`.
|
||||
For tests against the cloud a light weigh performance utility has been added. It currently exports only one method for tests: `execTimed( func, maxDelay, failMsg, successMsg)`. This method will execute the passed function and expect it to resolve by `maxDelay` milliseconds. Failures are thrown to cucumber and results are stored in a performance log buffer. This log is then dumped to the console after all tests have been run. They are also written to a CSV report file: `./report/performance.csv`.
|
||||
|
||||
For example, here is how it is used to check the redirect to the login page.
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ Feature: Dashboards - Dashboard - Cell Edit
|
|||
qa,_monitoring,_tasks
|
||||
"""
|
||||
When click the time machine bucket selector item "_monitoring"
|
||||
Then time machine bulider card "1" contains the empty tag message
|
||||
Then time machine builder card "1" contains the empty tag message
|
||||
When click the time machine bucket selector item "qa"
|
||||
Then there are "1" time machine builder cards
|
||||
Then time machine builder card "1" contains:
|
||||
|
|
|
@ -147,7 +147,7 @@ AfterAll(async function ( ) {
|
|||
|
||||
if(perfUtils.performanceLog.length > 0){
|
||||
await perfUtils.writePerformanceLog();
|
||||
await perfUtils.writePerfomanceReport();
|
||||
await perfUtils.writePerformanceReport();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class basePage{
|
|||
await this.driver.wait(until.elementLocated(By.xpath(selectors[i].selector)), 5000);
|
||||
break;
|
||||
default:
|
||||
throw `Unkown selector type ${JSON.stringify(selectors[i])}`;
|
||||
throw `Unknown selector type ${JSON.stringify(selectors[i])}`;
|
||||
}
|
||||
|
||||
// TODO - implement other selector types
|
||||
|
@ -143,7 +143,7 @@ class basePage{
|
|||
});
|
||||
break;
|
||||
default:
|
||||
throw `Unkown selector type ${JSON.stringify(selector)}`;
|
||||
throw `Unknown selector type ${JSON.stringify(selector)}`;
|
||||
}
|
||||
await resultElem.isEnabled();
|
||||
} catch (e) {
|
||||
|
@ -171,7 +171,7 @@ class basePage{
|
|||
return elements.length === 0;
|
||||
});
|
||||
default:
|
||||
throw `Unkown selector type ${JSON.stringify(selector)}`;
|
||||
throw `Unknown selector type ${JSON.stringify(selector)}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ class splashPage extends basePage {
|
|||
}
|
||||
|
||||
async getHeadMain(){
|
||||
//promises 201 - passing promisses between methods
|
||||
//promises 201 - passing promises between methods
|
||||
//N.B. returns a promise wrapping the element
|
||||
return await this.driver.findElement(By.css(headMain));
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ Then(/^the item "(.*)" in builder card "(.*)" is selected$/, async (item,index)
|
|||
await celOvSteps.verifyItemSelectedInBuilderCard(index, item);
|
||||
})
|
||||
|
||||
Then(/^time machine bulider card "(.*)" contains the empty tag message$/, async index => {
|
||||
Then(/^time machine builder card "(.*)" contains the empty tag message$/, async index => {
|
||||
await celOvSteps.verifyEmptyTagsInBuilderCard(index);
|
||||
});
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ When(/^move horizontally to "(.*)" of graph cell named "(.*)"$/, async (fraction
|
|||
});
|
||||
|
||||
When(/^drag horizontally to "(.*)" of graph cell named "(.*)"$/, async (fraction, name) => {
|
||||
await dbdSteps.dragToHorizonatlFractionOfGraphCell(fraction, name);
|
||||
await dbdSteps.dragToHorizontalFractionOfGraphCell(fraction, name);
|
||||
});
|
||||
|
||||
When(/^move vertically to "(.*)" of graph cell named "(.*)"$/, async (fraction, name) => {
|
||||
|
|
|
@ -107,7 +107,7 @@ When(/^enter "(.*)" in the popover label selector filter$/, async text => {
|
|||
});
|
||||
|
||||
Then(/^there are "(.*)" label pills in the select label popover$/, async count => {
|
||||
await dbdsSteps.verifyDasboardAddLabelsPillCount(count);
|
||||
await dbdsSteps.verifyDashboardAddLabelsPillCount(count);
|
||||
});
|
||||
|
||||
Then(/^the create new label item is not visible in the popover$/, async () => {
|
||||
|
@ -127,7 +127,7 @@ Then(/^the dashboard card "(.*)" has the label "(.*)"$/, async (name, label) =>
|
|||
});
|
||||
|
||||
When(/^click the add label button for the dashboard card "(.*)"$/, async name => {
|
||||
await dbdsSteps.clickDasboardCardAddLabel(name);
|
||||
await dbdsSteps.clickDashboardCardAddLabel(name);
|
||||
});
|
||||
|
||||
When(/^hover over the label "(.*)" of the dashboard card "(.*)"$/, async (label,name) => {
|
||||
|
|
|
@ -42,7 +42,7 @@ When(/^move horizontally to "(.*)" of the graph$/, async (fraction) => {
|
|||
});
|
||||
|
||||
When(/^drag horizontally to "(.*)" of the graph$/, async (fraction) => {
|
||||
await deSteps.dragToHorizonatalFractionOfGraph(fraction);
|
||||
await deSteps.dragToHorizontalFractionOfGraph(fraction);
|
||||
});
|
||||
|
||||
Then(/^the graph has changed$/, async() => {
|
||||
|
|
|
@ -13,7 +13,7 @@ class createOrgSteps extends baseSteps {
|
|||
await this.createOrgPage.isLoaded();
|
||||
}
|
||||
|
||||
//for assrtions
|
||||
//for assertions
|
||||
async verifyIsLoaded(){
|
||||
this.assertVisible(await this.createOrgPage.getInputOrgName());
|
||||
this.assertVisible(await this.createOrgPage.getInputBucketName());
|
||||
|
|
|
@ -263,7 +263,7 @@ class dashboardSteps extends influxSteps {
|
|||
async clickDashboardPopOverlayAddNote(){
|
||||
await this.clickAndWait(await this.dbdPage.getCellPopoverContentsAddNote(), async () => {
|
||||
//await this.driver.wait(
|
||||
//until.elementLocated(By.css(basePage.getPopupBodySelector().selector)) // not working consistentlly
|
||||
//until.elementLocated(By.css(basePage.getPopupBodySelector().selector)) // not working consistently
|
||||
//);
|
||||
await this.driver.sleep(1000); //sometimes slow and then overrun by downstream steps
|
||||
});
|
||||
|
@ -524,7 +524,7 @@ class dashboardSteps extends influxSteps {
|
|||
});
|
||||
}
|
||||
|
||||
async dragToHorizonatlFractionOfGraphCell(fraction, name){
|
||||
async dragToHorizontalFractionOfGraphCell(fraction, name){
|
||||
let fract = fraction.split('/');
|
||||
let denom = fract[1];
|
||||
let numer = fract[0];
|
||||
|
|
|
@ -132,7 +132,7 @@ class dashboardsSteps extends influxSteps {
|
|||
await this.typeTextAndWait(await this.dbdsPage.getAddLabelsPopoverFilter(), text);
|
||||
}
|
||||
|
||||
async verifyDasboardAddLabelsPillCount(count){
|
||||
async verifyDashboardAddLabelsPillCount(count){
|
||||
await this.dbdsPage.getAddLabelsLabelPills().then(async pills => {
|
||||
expect(pills.length).to.equal(parseInt(count));
|
||||
});
|
||||
|
@ -155,7 +155,7 @@ class dashboardsSteps extends influxSteps {
|
|||
await this.assertVisible(await this.dbdsPage.getDashboardCardLabelPill(name, label));
|
||||
}
|
||||
|
||||
async clickDasboardCardAddLabel(name){
|
||||
async clickDashboardCardAddLabel(name){
|
||||
await this.clickAndWait(await this.dbdsPage.getDashboardCardAddLabels(name));
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class dataExplorerSteps extends influxSteps {
|
|||
});
|
||||
}
|
||||
|
||||
async dragToHorizonatalFractionOfGraph(fraction){
|
||||
async dragToHorizontalFractionOfGraph(fraction){
|
||||
let fract = fraction.split('/');
|
||||
let denom = fract[1];
|
||||
let numer = fract[0];
|
||||
|
@ -418,7 +418,7 @@ class dataExplorerSteps extends influxSteps {
|
|||
elem = await this.dePage.getSaveAsPopupTabVar();
|
||||
break;
|
||||
default:
|
||||
throw `Unkown menu item ${item}`;
|
||||
throw `Unknown menu item ${item}`;
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
|
|
@ -68,7 +68,7 @@ class influxSteps extends baseSteps {
|
|||
elem = await this.influxPage.getNavMenuUser();
|
||||
break;
|
||||
default:
|
||||
throw `Unkown menu item ${item}`;
|
||||
throw `Unknown menu item ${item}`;
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
@ -87,7 +87,7 @@ class influxSteps extends baseSteps {
|
|||
elem = await this.influxPage.getUserMenuItem('logout');
|
||||
break;
|
||||
default:
|
||||
throw `Unkown menu item ${item}`;
|
||||
throw `Unknown menu item ${item}`;
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
@ -103,7 +103,7 @@ class influxSteps extends baseSteps {
|
|||
}else if(state === 'visible'){
|
||||
this.assertVisible(await this.getNavMenuElem(item));
|
||||
}else{
|
||||
throw `unkown menu state ${state}`;
|
||||
throw `unknown menu state ${state}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ class influxSteps extends baseSteps {
|
|||
}else if(state === 'visible'){
|
||||
this.assertVisible(await this.getUserMenuElem(item));
|
||||
}else{
|
||||
throw `unkown menu state ${state}`;
|
||||
throw `unknown menu state ${state}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ class signinSteps extends baseSteps {
|
|||
await this.driver.wait(until.elementIsVisible(await this.signinPage.getNameInput()), timeout,
|
||||
`Waited ${timeout} milliseconds to locate signin name input`);
|
||||
await this.driver.wait(until.elementIsVisible(await this.signinPage.getPasswordInput()), timeout,
|
||||
`Waited ${timeout} milliseconds to locate signin pasword input`);
|
||||
`Waited ${timeout} milliseconds to locate signin password input`);
|
||||
}
|
||||
|
||||
async signin(user){
|
||||
|
|
|
@ -9,7 +9,7 @@ var options = {
|
|||
launchReport: false,
|
||||
metadata: {
|
||||
'App Version':'2.0.0-alpha',
|
||||
'Test Environment': 'Deveolop',
|
||||
'Test Environment': 'Develop',
|
||||
'Browser': 'Chrome 74',
|
||||
'Platform': 'Ubuntu 16.04',
|
||||
'Parallel': 'Scenarios',
|
||||
|
|
|
@ -218,7 +218,7 @@ const setupNewUser = async(newUser) => {
|
|||
`at ${__config.host}. User should already exist there` );
|
||||
break;
|
||||
default:
|
||||
throw `Unkown create user method ${__config.create_method}`
|
||||
throw `Unknown create user method ${__config.create_method}`
|
||||
}
|
||||
|
||||
putUser(user);
|
||||
|
|
|
@ -111,7 +111,7 @@ const writePerformanceLog = async () => {
|
|||
console.log()
|
||||
};
|
||||
|
||||
const writePerfomanceReport = async (filename = performanceRecFile) => {
|
||||
const writePerformanceReport = async (filename = performanceRecFile) => {
|
||||
|
||||
let header = [];
|
||||
|
||||
|
@ -145,5 +145,5 @@ module.exports = {
|
|||
execTimed,
|
||||
performanceLog,
|
||||
writePerformanceLog,
|
||||
writePerfomanceReport
|
||||
writePerformanceReport
|
||||
};
|
||||
|
|
|
@ -24,7 +24,7 @@ This is inspired from Ben Johnson's blog post [Failure is Your Domain](https://m
|
|||
|
||||
## Use Case Example
|
||||
|
||||
We inplement the following interface
|
||||
We implement the following interface
|
||||
|
||||
```go
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// handler implents nats Handler interface.
|
||||
// handler implements nats Handler interface.
|
||||
type handler struct {
|
||||
Scraper Scraper
|
||||
Publisher nats.Publisher
|
||||
|
|
|
@ -193,10 +193,10 @@ func TestMetricsMarshal(t *testing.T) {
|
|||
result := make([]Metrics, 0)
|
||||
err = json.Unmarshal(b, &result)
|
||||
if err != nil {
|
||||
t.Fatalf("error in unmarshaling metrics: b: %s, %v", string(b), err)
|
||||
t.Fatalf("error in unmarshalling metrics: b: %s, %v", string(b), err)
|
||||
}
|
||||
if diff := cmp.Diff(c.ms, result, nil); diff != "" {
|
||||
t.Fatalf("unmarshaling metrics is incorrect, want %v, got %v", c.ms, result)
|
||||
t.Fatalf("unmarshalling metrics is incorrect, want %v, got %v", c.ms, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ type Scheduler struct {
|
|||
Targets influxdb.ScraperTargetStoreService
|
||||
// Interval is between each metrics gathering event.
|
||||
Interval time.Duration
|
||||
// Timeout is the maxisium time duration allowed by each TCP request
|
||||
// Timeout is the maximum time duration allowed by each TCP request
|
||||
Timeout time.Duration
|
||||
|
||||
// Publisher will send the gather requests and gathered metrics to the queue.
|
||||
|
|
|
@ -75,7 +75,7 @@ func TestAPIHandler_NotFound(t *testing.T) {
|
|||
t.Errorf("%q. get %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -362,7 +362,7 @@ func TestService_handleGetAuthorizations(t *testing.T) {
|
|||
t.Errorf("%q. handleGetAuthorizations() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetAuthorizations(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetAuthorizations(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetAuthorizations() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ func TestService_handleGetAuthorization(t *testing.T) {
|
|||
t.Errorf("%q. handleGetAuthorization() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetAuthorization. error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetAuthorization. error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetAuthorization() = -got/+want %s**", tt.name, diff)
|
||||
}
|
||||
|
@ -732,7 +732,7 @@ func TestService_handlePostAuthorization(t *testing.T) {
|
|||
t.Errorf("%q. handlePostAuthorization() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostAuthorization(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostAuthorization(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostAuthorization() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ func TestService_handleDeleteAuthorization(t *testing.T) {
|
|||
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteAuthorization(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteAuthorization(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteAuthorization() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ func TestService_handleGetBucket(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetBucket(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetBucket(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetBucket() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ func TestService_handlePostBucket(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostBucket(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostBucket(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostBucket() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -621,7 +621,7 @@ func TestService_handleDeleteBucket(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteBucket(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteBucket(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteBucket() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1002,7 +1002,7 @@ func TestService_handlePatchBucket(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchBucket(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchBucket(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchBucket() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1097,7 +1097,7 @@ func TestService_handlePostBucketMember(t *testing.T) {
|
|||
t.Errorf("%q. handlePostBucketMember() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostBucketMember(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostBucketMember(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostBucketMember() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1191,7 +1191,7 @@ func TestService_handlePostBucketOwner(t *testing.T) {
|
|||
t.Errorf("%q. handlePostBucketOwner() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostBucketOwner(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostBucketOwner(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostBucketOwner() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -599,7 +599,7 @@ func TestService_handleGetCheck(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetCheck(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetCheck(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetCheck() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ func TestService_handlePostCheck(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostCheck(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostCheck(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostCheck() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -868,7 +868,7 @@ func TestService_handleDeleteCheck(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteCheck(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteCheck(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteCheck() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ func TestService_handlePatchCheck(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchCheck(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchCheck(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchCheck() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1233,7 +1233,7 @@ func TestService_handleUpdateCheck(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePutCheck(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePutCheck(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePutCheck() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1333,7 +1333,7 @@ func TestService_handlePostCheckMember(t *testing.T) {
|
|||
t.Errorf("%q. handlePostCheckMember() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostCheckMember(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostCheckMember(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostCheckMember() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1427,7 +1427,7 @@ func TestService_handlePostCheckOwner(t *testing.T) {
|
|||
t.Errorf("%q. handlePostCheckOwner() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostCheckOwner(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostCheckOwner(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostCheckOwner() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ const (
|
|||
prefixDelete = "/api/v2/delete"
|
||||
)
|
||||
|
||||
// NewDeleteHandler creates a new handler at /api/v2/delete to recieve delete requests.
|
||||
// NewDeleteHandler creates a new handler at /api/v2/delete to receive delete requests.
|
||||
func NewDeleteHandler(log *zap.Logger, b *DeleteBackend) *DeleteHandler {
|
||||
h := &DeleteHandler{
|
||||
HTTPErrorHandler: b.HTTPErrorHandler,
|
||||
|
@ -122,7 +122,7 @@ func (h *DeleteHandler) handleDelete(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
h.log.Debug("Deleted",
|
||||
zap.String("orgID", fmt.Sprint(dr.Org.ID.String())),
|
||||
zap.String("buketID", fmt.Sprint(dr.Bucket.ID.String())),
|
||||
zap.String("bucketID", fmt.Sprint(dr.Bucket.ID.String())),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ func TestDelete(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDelete(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDelete(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDelete() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ func TestService_handleDeleteDocumentLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteDocumentLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteDocumentLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteDocumentLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ func TestService_handlePostDocumentLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostDocumentLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostDocumentLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostDocumentLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ func TestService_handleGetDocumentLabels(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetDocumentLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetDocumentLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetDocumentLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ func TestService_handleGetDocuments(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetDocuments(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetDocuments(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetDocuments() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -950,7 +950,7 @@ func TestService_handlePostDocuments(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(tt.wants.body, string(body)); err != nil {
|
||||
t.Errorf("%q, handlePostDocument(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostDocument(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostDocument() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
h.r.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
// PrometheusCollectors satisifies prom.PrometheusCollector.
|
||||
// PrometheusCollectors satisfies prom.PrometheusCollector.
|
||||
func (h *Handler) PrometheusCollectors() []prometheus.Collector {
|
||||
return []prometheus.Collector{
|
||||
h.requests,
|
||||
|
|
|
@ -46,7 +46,7 @@ func TestHealthHandler(t *testing.T) {
|
|||
}
|
||||
var content map[string]interface{}
|
||||
if err := json.Unmarshal(body, &content); err != nil {
|
||||
t.Errorf("%q, HealthHandler(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, HealthHandler(). error unmarshalling json %v", tt.name, err)
|
||||
return
|
||||
}
|
||||
if _, found := content["name"]; !found {
|
||||
|
|
|
@ -123,7 +123,7 @@ func (h *LabelHandler) handleGetLabels(w http.ResponseWriter, r *http.Request) {
|
|||
h.HandleHTTPError(ctx, err, w)
|
||||
return
|
||||
}
|
||||
h.log.Debug("Labels retrived", zap.String("labels", fmt.Sprint(labels)))
|
||||
h.log.Debug("Labels retrieved", zap.String("labels", fmt.Sprint(labels)))
|
||||
err = encodeResponse(ctx, w, http.StatusOK, newLabelsResponse(labels))
|
||||
if err != nil {
|
||||
h.HandleHTTPError(ctx, err, w)
|
||||
|
|
|
@ -249,7 +249,7 @@ func TestService_handleGetLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ func TestService_handleDeleteLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ func TestService_handlePatchLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ func TestService_handleGetNotificationEndpoint(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetNotificationEndpoint(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetNotificationEndpoint(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetNotificationEndpoint() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ func TestService_handlePostNotificationEndpoint(t *testing.T) {
|
|||
ExpectBody(func(body *bytes.Buffer) {
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(body.String(), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostNotificationEndpoint(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostNotificationEndpoint(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostNotificationEndpoint() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ func TestService_handleDeleteNotificationEndpoint(t *testing.T) {
|
|||
ExpectBody(func(buf *bytes.Buffer) {
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(buf.String(), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteNotificationEndpoint(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteNotificationEndpoint(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteNotificationEndpoint() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ func TestService_handlePatchNotificationEndpoint(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchNotificationEndpoint(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchNotificationEndpoint(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchNotificationEndpoint() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ func TestService_handleUpdateNotificationEndpoint(t *testing.T) {
|
|||
ExpectBody(func(body *bytes.Buffer) {
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(body.String(), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePutNotificationEndpoint(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePutNotificationEndpoint(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePutNotificationEndpoint() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -959,7 +959,7 @@ func TestService_handlePostNotificationEndpointMember(t *testing.T) {
|
|||
t.Errorf("%q. handlePostNotificationEndpointMember() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostNotificationEndpointMember(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostNotificationEndpointMember(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostNotificationEndpointMember() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1053,7 +1053,7 @@ func TestService_handlePostNotificationEndpointOwner(t *testing.T) {
|
|||
t.Errorf("%q. handlePostNotificationEndpointOwner() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostNotificationEndpointOwner(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostNotificationEndpointOwner(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handlePostNotificationEndpointOwner() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ func TestSecretService_handleGetSecrets(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetSecrets(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetSecrets(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetSecrets() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ func TestSecretService_handlePatchSecrets(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchSecrets(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchSecrets(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchSecrets() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ func TestSecretService_handleDeleteSecrets(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteSecrets(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteSecrets(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteSecrets() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ func TestService_handleGetScraperTargets(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetScraperTargets(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetScraperTargets(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetScraperTargets() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ func TestService_handleGetScraperTarget(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetScraperTarget(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetScraperTarget(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetScraperTarget() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ func TestService_handleDeleteScraperTarget(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleDeleteScraperTarget(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleDeleteScraperTarget(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleDeleteScraperTarget() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ func TestService_handlePostScraperTarget(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostScraperTarget(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostScraperTarget(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostScraperTarget() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ func TestService_handlePatchScraperTarget(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePatchScraperTarget(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePatchScraperTarget(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePatchScraperTarget() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ func (h *TaskHandler) handleGetTasks(w http.ResponseWriter, r *http.Request) {
|
|||
h.HandleHTTPError(ctx, err, w)
|
||||
return
|
||||
}
|
||||
h.log.Debug("Tasks retrived", zap.String("tasks", fmt.Sprint(tasks)))
|
||||
h.log.Debug("Tasks retrieved", zap.String("tasks", fmt.Sprint(tasks)))
|
||||
if err := encodeResponse(ctx, w, http.StatusOK, newTasksResponse(ctx, tasks, req.filter, h.LabelService)); err != nil {
|
||||
logEncodingError(h.log, r, err)
|
||||
return
|
||||
|
|
|
@ -409,7 +409,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(tt.wants.body, string(body)); err != nil {
|
||||
t.Errorf("%q, handleGetTasks(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetTasks(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetTasks() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ func TestTaskHandler_handlePostTasks(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(tt.wants.body, string(body)); err != nil {
|
||||
t.Errorf("%q, handlePostTask(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostTask(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostTask() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ func TestTaskHandler_handleGetRun(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetRun(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetRun(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetRun() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -807,7 +807,7 @@ func TestTaskHandler_handleGetRuns(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetRuns(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetRuns(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetRuns() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -1197,7 +1197,7 @@ func TestService_handlePostTaskLabel(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handlePostTaskLabel(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handlePostTaskLabel(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handlePostTaskLabel() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ func TestTelegrafHandler_handleGetTelegrafs(t *testing.T) {
|
|||
}
|
||||
if tt.wants.body != "" {
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetTelegrafs(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetTelegrafs(). error unmarshalling json %v", tt.name, err)
|
||||
} else if !eq {
|
||||
t.Errorf("%q. handleGetTelegrafs() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ func TestUserResourceMappingService_PostMembersHandler(t *testing.T) {
|
|||
t.Errorf("%q. PostMembersHandler() = %v, want %v", tt.name, content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, PostMembersHandler(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, PostMembersHandler(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. PostMembersHandler() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -624,7 +624,7 @@ func (s *PasswordService) ComparePassword(ctx context.Context, userID influxdb.I
|
|||
panic("not implemented")
|
||||
}
|
||||
|
||||
// CompareAndSetPassword compares the old and new password and submits the new password if possoble.
|
||||
// CompareAndSetPassword compares the old and new password and submits the new password if possible.
|
||||
// Note: is not implemented.
|
||||
func (s *PasswordService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error {
|
||||
panic("not implemented")
|
||||
|
|
|
@ -326,7 +326,7 @@ func TestVariableService_handleGetVariables(t *testing.T) {
|
|||
t.Errorf("%q. handleGetVariables() = %v, want %v", tt.name, contentType, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, handleGetDashboards(). error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, handleGetDashboards(). error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. handleGetDashboards() = ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ func TestVariableService_handleGetVariable(t *testing.T) {
|
|||
t.Errorf("got = %v, want %v", contentType, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ func TestVariableService_handlePostVariable(t *testing.T) {
|
|||
t.Errorf("got = %v, want %v", contentType, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -690,7 +690,7 @@ func TestVariableService_handlePutVariable(t *testing.T) {
|
|||
t.Errorf("got = %v, want %v", contentType, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -799,7 +799,7 @@ func TestVariableService_handlePatchVariable(t *testing.T) {
|
|||
t.Errorf("got = %v, want %v", contentType, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ func TestService_handlePostVariableLabel(t *testing.T) {
|
|||
t.Errorf("got %v, want %v", content, tt.wants.contentType)
|
||||
}
|
||||
if eq, diff, err := jsonEqual(string(body), tt.wants.body); err != nil {
|
||||
t.Errorf("%q, error unmarshaling json %v", tt.name, err)
|
||||
t.Errorf("%q, error unmarshalling json %v", tt.name, err)
|
||||
} else if tt.wants.body != "" && !eq {
|
||||
t.Errorf("%q. ***%s***", tt.name, diff)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ type Point interface {
|
|||
// The value at the given time.
|
||||
value() interface{}
|
||||
|
||||
// Auxillary values passed along with the value.
|
||||
// Auxiliary values passed along with the value.
|
||||
aux() []interface{}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ func (a Points) Clone() []Point {
|
|||
}
|
||||
|
||||
// Tags represent a map of keys and values.
|
||||
// It memoizes its key so it can be used efficiently during query execution.
|
||||
// It memorizes its key so it can be used efficiently during query execution.
|
||||
type Tags struct {
|
||||
id string
|
||||
m map[string]string
|
||||
|
|
|
@ -827,7 +827,7 @@ func buildAuxIterator(ctx context.Context, ic IteratorCreator, sources influxql.
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Merge iterators to read auxilary fields.
|
||||
// Merge iterators to read auxiliary fields.
|
||||
input, err := Iterators(inputs).Merge(opt)
|
||||
if err != nil {
|
||||
Iterators(inputs).Close()
|
||||
|
|
|
@ -86,7 +86,7 @@ func (s *Service) FindSourceByID(ctx context.Context, id platform.ID) (*platform
|
|||
return src, nil
|
||||
}
|
||||
|
||||
// FindSources retrives all sources that match an arbitrary source filter.
|
||||
// FindSources retrieves all sources that match an arbitrary source filter.
|
||||
// Filters using ID, or OrganizationID and source Name should be efficient.
|
||||
// Other filters will do a linear scan across all sources searching for a match.
|
||||
func (s *Service) FindSources(ctx context.Context, opt platform.FindOptions) ([]*platform.Source, int, error) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
type (
|
||||
// CollectFnOpts provides arugments to the collect operation of a metric.
|
||||
// CollectFnOpts provides arguments to the collect operation of a metric.
|
||||
CollectFnOpts struct {
|
||||
Method string
|
||||
Start time.Time
|
||||
|
|
|
@ -68,7 +68,7 @@ func WithEncodeGZIP() APIOptFn {
|
|||
}
|
||||
}
|
||||
|
||||
// WithUnmarshalErrFn sets the error handler for errors that occur when unmarshaling
|
||||
// WithUnmarshalErrFn sets the error handler for errors that occur when unmarshalling
|
||||
// the request body.
|
||||
func WithUnmarshalErrFn(fn func(encoding string, err error) error) APIOptFn {
|
||||
return func(api *API) {
|
||||
|
@ -232,7 +232,7 @@ func (a *API) Err(w http.ResponseWriter, r *http.Request, err error) {
|
|||
a.logErr("failed to write err to response writer", zap.Error(err))
|
||||
a.Respond(w, r, http.StatusInternalServerError, ErrBody{
|
||||
Code: "internal error",
|
||||
Msg: "an unexpected error occured",
|
||||
Msg: "an unexpected error occurred",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ func Test_API(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
t.Run("unmarshal err fn wraps unmarshaling error", func(t *testing.T) {
|
||||
t.Run("unmarshal err fn wraps unmarshalling error", func(t *testing.T) {
|
||||
t.Run("json", func(t *testing.T) {
|
||||
invalidBody := []byte("[}-{]")
|
||||
|
||||
|
@ -290,7 +290,7 @@ func (v *validatFoo) OK() error {
|
|||
errs = append(errs, "foo must be at least 1 char")
|
||||
}
|
||||
if v.Bar < 0 {
|
||||
errs = append(errs, "bar must be a postive real number")
|
||||
errs = append(errs, "bar must be a positive real number")
|
||||
}
|
||||
return errs.toError()
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ type Enabler interface {
|
|||
Enabled(ctx context.Context, flagger ...feature.Flagger) bool
|
||||
}
|
||||
|
||||
// FeatureHandler is used to switch requests between an exisiting and a feature flagged
|
||||
// FeatureHandler is used to switch requests between an existing and a feature flagged
|
||||
// HTTP Handler on a per-request basis
|
||||
type FeatureHandler struct {
|
||||
enabler Enabler
|
||||
|
|
|
@ -207,7 +207,7 @@ func filterAuthorizationsFn(filter influxdb.AuthorizationFilter) func(a *influxd
|
|||
return func(a *influxdb.Authorization) bool { return true }
|
||||
}
|
||||
|
||||
// FindAuthorizations retrives all authorizations that match an arbitrary authorization filter.
|
||||
// FindAuthorizations retrieves all authorizations that match an arbitrary authorization filter.
|
||||
// Filters using ID, or Token should be efficient.
|
||||
// Other filters will do a linear scan across all authorizations searching for a match.
|
||||
func (s *Service) FindAuthorizations(ctx context.Context, filter influxdb.AuthorizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Authorization, int, error) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue