From 7f3778e7939711828549b070b0789d850651e5ef Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Mon, 6 Apr 2020 18:53:03 -0400 Subject: [PATCH] Typos Fix (#1236) * Fix Typo * Fixed More Typos --- adapters/adapterstest/test_json.go | 2 +- analytics/config/config_test.go | 6 +++--- config/config.go | 2 +- config/config_test.go | 4 ++-- config/stored_requests.go | 2 +- docs/bidders/appnexus.md | 2 +- docs/bidders/audienceNetwork.md | 2 +- docs/bidders/sovrn.md | 2 +- docs/developers/automated-tests.md | 2 +- docs/developers/cookie-syncs.md | 2 +- docs/developers/default-request.md | 6 +++--- docs/endpoints/openrtb2/amp.md | 2 +- docs/endpoints/openrtb2/auction.md | 8 +++---- endpoints/openrtb2/amp_auction_test.go | 10 ++++----- endpoints/openrtb2/auction_test.go | 10 ++++----- endpoints/openrtb2/video_auction_test.go | 6 +++--- exchange/bidder.go | 2 +- exchange/exchange_test.go | 2 +- gdpr/gdpr.go | 6 +++--- main.go | 4 +++- openrtb_ext/bid.go | 2 +- openrtb_ext/request.go | 4 ++-- openrtb_ext/request_test.go | 8 +++---- pbsmetrics/metrics.go | 2 +- pbsmetrics/prometheus/prometheus.go | 4 ++-- pbsmetrics/prometheus/prometheus_test.go | 6 +++--- .../aspects/request_timeout_handler_test.go | 21 ++++++++++--------- ssl/ssl_test.go | 2 +- 28 files changed, 67 insertions(+), 64 deletions(-) diff --git a/adapters/adapterstest/test_json.go b/adapters/adapterstest/test_json.go index a0d1954894a..7602ab16e41 100644 --- a/adapters/adapterstest/test_json.go +++ b/adapters/adapterstest/test_json.go @@ -301,7 +301,7 @@ func diffJson(t *testing.T, description string, actual []byte, expected []byte) if diff.Modified() { var left interface{} if err := json.Unmarshal(actual, &left); err != nil { - t.Fatalf("%s json did not match, but unmarhsalling failed. %v", description, err) + t.Fatalf("%s json did not match, but unmarshalling failed. %v", description, err) } printer := formatter.NewAsciiFormatter(left, formatter.AsciiFormatterConfig{ ShowArrayIndex: true, diff --git a/analytics/config/config_test.go b/analytics/config/config_test.go index 0fd3ec2019e..7d97fb5f1be 100644 --- a/analytics/config/config_test.go +++ b/analytics/config/config_test.go @@ -22,7 +22,7 @@ func TestSampleModule(t *testing.T) { Response: &openrtb.BidResponse{}, }) if count != 1 { - t.Errorf("PBSAnalyticsModule failed at LogAuctionObejct") + t.Errorf("PBSAnalyticsModule failed at LogAuctionObject") } am.LogSetUIDObject(&analytics.SetUIDObject{ @@ -33,12 +33,12 @@ func TestSampleModule(t *testing.T) { Success: true, }) if count != 2 { - t.Errorf("PBSAnalyticsModule failed at LogSetUIDObejct") + t.Errorf("PBSAnalyticsModule failed at LogSetUIDObject") } am.LogCookieSyncObject(&analytics.CookieSyncObject{}) if count != 3 { - t.Errorf("PBSAnalyticsModule failed at LogCookieSyncObejct") + t.Errorf("PBSAnalyticsModule failed at LogCookieSyncObject") } am.LogAmpObject(&analytics.AmpObject{}) diff --git a/config/config.go b/config/config.go index 999b1870b54..2cb5f8f2e66 100644 --- a/config/config.go +++ b/config/config.go @@ -221,7 +221,7 @@ const ( type Adapter struct { Endpoint string `mapstructure:"endpoint"` // Required // UserSyncURL is the URL returned by /cookie_sync for this Bidder. It is _usually_ optional. - // If not defined, sensible defaults will be derved based on the config.external_url. + // If not defined, sensible defaults will be derived based on the config.external_url. // Note that some Bidders don't have sensible defaults, because their APIs require an ID that will vary // from one PBS host to another. // diff --git a/config/config_test.go b/config/config_test.go index 78630e071d9..9677ce2aaba 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -417,9 +417,9 @@ func TestCookieSizeError(t *testing.T) { } for i := range testCases { if testCases[i].expectError { - assert.Error(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCooki.MaxCookieSizeBytes less than MIN_COOKIE_SIZE_BYTES = %d and not equal to zero should return an error", MIN_COOKIE_SIZE_BYTES)) + assert.Error(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCookie.MaxCookieSizeBytes less than MIN_COOKIE_SIZE_BYTES = %d and not equal to zero should return an error", MIN_COOKIE_SIZE_BYTES)) } else { - assert.NoError(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCooki.MaxCookieSizeBytes greater than MIN_COOKIE_SIZE_BYTES = %d or equal to zero should not return an error", MIN_COOKIE_SIZE_BYTES)) + assert.NoError(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCookie.MaxCookieSizeBytes greater than MIN_COOKIE_SIZE_BYTES = %d or equal to zero should not return an error", MIN_COOKIE_SIZE_BYTES)) } } } diff --git a/config/stored_requests.go b/config/stored_requests.go index 0d9e773205e..04e400f9b7c 100644 --- a/config/stored_requests.go +++ b/config/stored_requests.go @@ -402,7 +402,7 @@ func (cfg *PostgresUpdatePolling) validate(errs configErrors) configErrors { return errs } -// MakeQuery builds a query which can fetch numReqs Stored Requetss and numImps Stored Imps. +// MakeQuery builds a query which can fetch numReqs Stored Requests and numImps Stored Imps. // See the docs on PostgresConfig.QueryTemplate for a description of how it works. func (cfg *PostgresFetcherQueriesSlim) MakeQuery(numReqs int, numImps int) (query string) { return resolve(cfg.QueryTemplate, numReqs, numImps) diff --git a/docs/bidders/appnexus.md b/docs/bidders/appnexus.md index 8b706adc122..e4032313f25 100644 --- a/docs/bidders/appnexus.md +++ b/docs/bidders/appnexus.md @@ -15,7 +15,7 @@ The AppNexus endpoint expects `imp.displaymanagerver` to be populated for mobile requests, however not all SDKs will populate this field. If the `imp.displaymanagerver` field is not supplied for an `imp`, but `request.app.ext.prebid.source` and `request.app.ext.prebid.version` are supplied, the adapter will fill in a value for -`diplaymanagerver`. It will concatonate the two `app` fields as `-` fo fill in +`diplaymanagerver`. It will concatenate the two `app` fields as `-` fo fill in the empty `displaymanagerver` before sending the request to AppNexus. ## Test Request diff --git a/docs/bidders/audienceNetwork.md b/docs/bidders/audienceNetwork.md index 04357d616b1..d55e8218a81 100644 --- a/docs/bidders/audienceNetwork.md +++ b/docs/bidders/audienceNetwork.md @@ -3,6 +3,6 @@ ## Mobile Bids Audience Network will not bid on requests made from device simulators. -When testingfor Mobile bids, you must make bid requests using a real device. +When testing for Mobile bids, you must make bid requests using a real device. **Note:** Audience Network is disabled by default. Please enable it in the app config if you wish to use it. Make sure you provide the partnerID for the auctions to run correctly. \ No newline at end of file diff --git a/docs/bidders/sovrn.md b/docs/bidders/sovrn.md index 544cb8a6764..bc6d42333e8 100644 --- a/docs/bidders/sovrn.md +++ b/docs/bidders/sovrn.md @@ -1,3 +1,3 @@ Sovrn supports 2 parameters to be present in the `ext` object of impressions sent to it: - tagid: a string containing the sovrn-specific id(s) for the publisher's ad tag(s) they would like to bid with. This is a required field -- bidfloor: The minimium acceptable bid, in CPM, using US Dollars. This is an optional field. \ No newline at end of file +- bidfloor: The minimum acceptable bid, in CPM, using US Dollars. This is an optional field. \ No newline at end of file diff --git a/docs/developers/automated-tests.md b/docs/developers/automated-tests.md index 12532237e08..0dff9b04212 100644 --- a/docs/developers/automated-tests.md +++ b/docs/developers/automated-tests.md @@ -9,7 +9,7 @@ To reproduce these tests locally, use: ## Writing Tests -Tests for `some-file.go` should be placed in the file `some-file_test.go` in the same paackage. +Tests for `some-file.go` should be placed in the file `some-file_test.go` in the same package. For more info on how to write tests in Go, see [the Go docs](https://golang.org/pkg/testing/). ## Adapter Tests diff --git a/docs/developers/cookie-syncs.md b/docs/developers/cookie-syncs.md index 36c6b85b636..75a3e3b0ef8 100644 --- a/docs/developers/cookie-syncs.md +++ b/docs/developers/cookie-syncs.md @@ -1,6 +1,6 @@ # Cookie Sync Technical Details -This document describes the mechancis of a Prebid Server cookie sync. +This document describes the mechanics of a Prebid Server cookie sync. ## Motivation diff --git a/docs/developers/default-request.md b/docs/developers/default-request.md index 2337ccd8da0..f071d91bad6 100644 --- a/docs/developers/default-request.md +++ b/docs/developers/default-request.md @@ -1,6 +1,6 @@ # Server Based Global Default Request -This allows a defaut stored request to be defined that allows the server to set up some defaults for all incoming requests. A request specified stored request will override these defaults, and of course any options specified directly in the stored request override both. The default stored request is only read on server startup, it is meant as an installation static default rather than a dynamic tuning option. +This allows a default stored request to be defined that allows the server to set up some defaults for all incoming requests. A request specified stored request will override these defaults, and of course any options specified directly in the stored request override both. The default stored request is only read on server startup, it is meant as an installation static default rather than a dynamic tuning option. A common use case is to "hard code" aliases into the server. This saves having to specify them on all incoming requests, and/or on all stored requests. To help support automation and alias discovery we can flag that any aliases found in the file be added to the bidder info endpoints. @@ -35,8 +35,8 @@ The `filename` option is the path/filename of a JSON file containing the default ``` This will be JSON merged into the incoming requests at the top level. These will be used as fallbacks which can be overridden by both Stored Requests _and_ the incoming HTTP request payload. -The `info` option determines if the alised bidders will be exposed on the `/info` endpoints. If true the alias name will be added to the list returned by -`/info/bidders` and the info JSON for the core bidder will be coppied into `/info/bidder/{biddername}` with the addition of the field +The `info` option determines if the aliased bidders will be exposed on the `/info` endpoints. If true the alias name will be added to the list returned by +`/info/bidders` and the info JSON for the core bidder will be copied into `/info/bidder/{biddername}` with the addition of the field `"alias_of": "{coreBidder}"` to indicate that it is an aliases, and of which core bidder. Turning the info support on may be useful for hosts that want to support automation around the `/info` endpoints that will include the predefined aliases. This config option may be deprecated in a future version to promote a consistency in the endpoint functionality, depending on the perceived need for the option. diff --git a/docs/endpoints/openrtb2/amp.md b/docs/endpoints/openrtb2/amp.md index b792ae6ec5d..16fa451ef36 100644 --- a/docs/endpoints/openrtb2/amp.md +++ b/docs/endpoints/openrtb2/amp.md @@ -100,7 +100,7 @@ This endpoint supports the following query parameters: 6. `curl` - the canonical URL of the page 7. `timeout` - the publisher-specified timeout for the RTC callout - A configuration option `amp_timeout_adjustment_ms` may be set to account for estimated latency so that Prebid Server can handle timeouts from adapters and respond to the AMP RTC request before it times out. -8. `debug` - When set to `1`, the respones will contain extra info for debugging. +8. `debug` - When set to `1`, the response will contain extra info for debugging. For information on how these get from AMP into this endpoint, see [this pull request adding the query params to the Prebid callout](https://github.com/ampproject/amphtml/pull/14155) and [this issue adding support for network-level RTC macros](https://github.com/ampproject/amphtml/issues/12374). diff --git a/docs/endpoints/openrtb2/auction.md b/docs/endpoints/openrtb2/auction.md index bd421850d1f..67430e51481 100644 --- a/docs/endpoints/openrtb2/auction.md +++ b/docs/endpoints/openrtb2/auction.md @@ -228,7 +228,7 @@ for each Bidder by using the `/cookie_sync` endpoint, and calling the URLs that #### Native Request -For each native request, the `assets` objects's `id` field must not be defined. Prebid Server will set this automatically, using the index of the asset in the array as the ID. +For each native request, the `assets` object's `id` field must not be defined. Prebid Server will set this automatically, using the index of the asset in the array as the ID. #### Bidder Aliases @@ -265,7 +265,7 @@ This can be used to request bids from the same Bidder with different params. For ``` For all intents and purposes, the alias will be treated as another Bidder. This new Bidder will behave exactly -like the original, except that the Response will contain seprate SeatBids, and any Targeting keys +like the original, except that the Response will contain separate SeatBids, and any Targeting keys will be formed using the alias' name. If an alias overlaps with a core Bidder's name, then the alias will take precedence. @@ -280,7 +280,7 @@ For example, if the Request defines an alias like this: ``` then any `imp.ext.appnexus` params will actually go to the **rubicon** adapter. -It will become impossible to fetch bids from Appnexus within that Request. +It will become impossible to fetch bids from AppNexus within that Request. #### Bidder Response Times @@ -495,7 +495,7 @@ client can declare a given adunit as eligible for rewards by declaring `imp.ext. While testing SDK and video integrations, it's important, but often difficult, to get consistent responses back from bidders that cover a range of scenarios like different CPM values, deals, etc. Prebid Server supports a debugging workflow in two ways: - a stored-auction-response that covers multiple bidder responses -- multiple stored-bid-reponses at the bidder adapter level +- multiple stored-bid-responses at the bidder adapter level **Single Stored Auction Response ID** diff --git a/endpoints/openrtb2/amp_auction_test.go b/endpoints/openrtb2/amp_auction_test.go index b25d5b0cc8f..9dc81eb1b9d 100644 --- a/endpoints/openrtb2/amp_auction_test.go +++ b/endpoints/openrtb2/amp_auction_test.go @@ -219,7 +219,7 @@ func TestGDPRConsent(t *testing.T) { responseRecorder := httptest.NewRecorder() endpoint(responseRecorder, request, nil) - // Parse Resonse + // Parse Response var response AmpResponse if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil { t.Fatalf("Error unmarshalling response: %s", err.Error()) @@ -372,7 +372,7 @@ func TestCCPAConsent(t *testing.T) { responseRecorder := httptest.NewRecorder() endpoint(responseRecorder, request, nil) - // Parse Resonse + // Parse Response var response AmpResponse if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil { t.Fatalf("Error unmarshalling response: %s", err.Error()) @@ -431,7 +431,7 @@ func TestNoConsent(t *testing.T) { responseRecorder := httptest.NewRecorder() endpoint(responseRecorder, request, nil) - // Parse Resonse + // Parse Response var response AmpResponse if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil { t.Fatalf("Error unmarshalling response: %s", err.Error()) @@ -478,7 +478,7 @@ func TestInvalidConsent(t *testing.T) { responseRecorder := httptest.NewRecorder() endpoint(responseRecorder, request, nil) - // Parse Resonse + // Parse Response var response AmpResponse if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil { t.Fatalf("Error unmarshalling response: %s", err.Error()) @@ -561,7 +561,7 @@ func TestNewAndLegacyConsentBothProvided(t *testing.T) { responseRecorder := httptest.NewRecorder() endpoint(responseRecorder, request, nil) - // Parse Resonse + // Parse Response var response AmpResponse if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil { t.Fatalf("Error unmarshalling response: %s", err.Error()) diff --git a/endpoints/openrtb2/auction_test.go b/endpoints/openrtb2/auction_test.go index 74a70c69415..98dfa66d6a4 100644 --- a/endpoints/openrtb2/auction_test.go +++ b/endpoints/openrtb2/auction_test.go @@ -175,7 +175,7 @@ func TestBadNativeRequests(t *testing.T) { tests.assert(t) } -// TestAliasedRequests makes sure we handle (defuault) aliased bidders properly +// TestAliasedRequests makes sure we handle (default) aliased bidders properly func TestAliasedRequests(t *testing.T) { tests := &getResponseFromDirectory{ dir: "sample-requests/aliased", @@ -289,7 +289,7 @@ func (gr *getResponseFromDirectory) assert(t *testing.T) { filesToAssert = append(filesToAssert, gr.dir+"/"+fileInfo.Name()) } } else { - // Just test the single `gr.file`, and not the entiriety of files that may be found in `gr.dir` + // Just test the single `gr.file`, and not the entirety of files that may be found in `gr.dir` filesToAssert = append(filesToAssert, gr.dir+"/"+gr.file) } @@ -805,7 +805,7 @@ func TestDisabledBidder(t *testing.T) { }, pbsmetrics.NewMetrics(metrics.NewRegistry(), openrtb_ext.BidderList(), config.DisabledMetrics{}), analyticsConf.NewPBSAnalytics(&config.Analytics{}), - map[string]string{"unknownbidder": "The biddder 'unknownbidder' has been disabled."}, + map[string]string{"unknownbidder": "The bidder 'unknownbidder' has been disabled."}, false, []byte{}, openrtb_ext.BidderMap, @@ -839,7 +839,7 @@ func TestValidateImpExtDisabledBidder(t *testing.T) { &config.Configuration{MaxRequestSize: int64(8096)}, pbsmetrics.NewMetrics(metrics.NewRegistry(), openrtb_ext.BidderList(), config.DisabledMetrics{}), analyticsConf.NewPBSAnalytics(&config.Analytics{}), - map[string]string{"unknownbidder": "The biddder 'unknownbidder' has been disabled."}, + map[string]string{"unknownbidder": "The bidder 'unknownbidder' has been disabled."}, false, []byte{}, openrtb_ext.BidderMap, @@ -847,7 +847,7 @@ func TestValidateImpExtDisabledBidder(t *testing.T) { } errs := deps.validateImpExt(imp, nil, 0) assert.JSONEq(t, `{"appnexus":{"placement_id":555}}`, string(imp.Ext)) - assert.Equal(t, []error{&errortypes.BidderTemporarilyDisabled{Message: "The biddder 'unknownbidder' has been disabled."}}, errs) + assert.Equal(t, []error{&errortypes.BidderTemporarilyDisabled{Message: "The bidder 'unknownbidder' has been disabled."}}, errs) } func TestEffectivePubID(t *testing.T) { diff --git a/endpoints/openrtb2/video_auction_test.go b/endpoints/openrtb2/video_auction_test.go index 0199b43f610..d0ce33de1c4 100644 --- a/endpoints/openrtb2/video_auction_test.go +++ b/endpoints/openrtb2/video_auction_test.go @@ -44,7 +44,7 @@ func TestVideoEndpointImpressionsNumber(t *testing.T) { respBytes := recorder.Body.Bytes() resp := &openrtb_ext.BidResponseVideo{} if err := json.Unmarshal(respBytes, resp); err != nil { - t.Fatalf("Unable to umarshal response.") + t.Fatalf("Unable to unmarshal response.") } assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request") @@ -197,7 +197,7 @@ func TestVideoEndpointDebugQueryTrue(t *testing.T) { respBytes := recorder.Body.Bytes() resp := &openrtb_ext.BidResponseVideo{} if err := json.Unmarshal(respBytes, resp); err != nil { - t.Fatalf("Unable to umarshal response.") + t.Fatalf("Unable to unmarshal response.") } assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request") @@ -239,7 +239,7 @@ func TestVideoEndpointDebugQueryFalse(t *testing.T) { respBytes := recorder.Body.Bytes() resp := &openrtb_ext.BidResponseVideo{} if err := json.Unmarshal(respBytes, resp); err != nil { - t.Fatalf("Unable to umarshal response.") + t.Fatalf("Unable to unmarshal response.") } assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request") diff --git a/exchange/bidder.go b/exchange/bidder.go index 97f64e74bb5..8e95835ffba 100644 --- a/exchange/bidder.go +++ b/exchange/bidder.go @@ -208,7 +208,7 @@ func addNativeTypes(bid *openrtb.Bid, request *openrtb.BidRequest) (*nativeRespo var errs []error var nativeMarkup *nativeResponse.Response if err := json.Unmarshal(json.RawMessage(bid.AdM), &nativeMarkup); err != nil || len(nativeMarkup.Assets) == 0 { - // Some bidders are returning non-IAB complaiant native markup. In this case Prebid server will not be able to add types. E.g Facebook + // Some bidders are returning non-IAB compliant native markup. In this case Prebid server will not be able to add types. E.g Facebook return nil, errs } diff --git a/exchange/exchange_test.go b/exchange/exchange_test.go index 7217e609189..2f115ca4f93 100644 --- a/exchange/exchange_test.go +++ b/exchange/exchange_test.go @@ -1762,7 +1762,7 @@ func diffJson(t *testing.T, description string, actual []byte, expected []byte) if diff.Modified() { var left interface{} if err := json.Unmarshal(actual, &left); err != nil { - t.Fatalf("%s json did not match, but unmarhsalling failed. %v", description, err) + t.Fatalf("%s json did not match, but unmarshalling failed. %v", description, err) } printer := formatter.NewAsciiFormatter(left, formatter.AsciiFormatterConfig{ ShowArrayIndex: true, diff --git a/gdpr/gdpr.go b/gdpr/gdpr.go index a6b64203a95..4e36e22fdb9 100644 --- a/gdpr/gdpr.go +++ b/gdpr/gdpr.go @@ -12,17 +12,17 @@ import ( type Permissions interface { // Determines whether or not the host company is allowed to read/write cookies. // - // If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent. + // If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent. HostCookiesAllowed(ctx context.Context, consent string) (bool, error) // Determines whether or not the given bidder is allowed to user personal info for ad targeting. // - // If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent. + // If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent. BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.BidderName, consent string) (bool, error) // Determines whether or not to send PI information to a bidder, or mask it out. // - // If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent. + // If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent. PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, consent string) (bool, error) } diff --git a/main.go b/main.go index ae3b7fd5705..d6ba430f059 100644 --- a/main.go +++ b/main.go @@ -42,9 +42,11 @@ func main() { } } +const configFileName = "pbs" + func loadConfig() (*config.Configuration, error) { v := viper.New() - config.SetupViper(v, "pbs") // filke = filename + config.SetupViper(v, configFileName) return config.New(v) } diff --git a/openrtb_ext/bid.go b/openrtb_ext/bid.go index 768128c96d6..3b297c7ab5d 100644 --- a/openrtb_ext/bid.go +++ b/openrtb_ext/bid.go @@ -87,7 +87,7 @@ const ( HbpbConstantKey TargetingKey = "hb_pb" // HbEnvKey exists to support the Prebid Universal Creative. If it exists, the only legal value is mobile-app. - // It will exist only if the incoming bidRequest defiend request.app instead of request.site. + // It will exist only if the incoming bidRequest defined request.app instead of request.site. HbEnvKey TargetingKey = "hb_env" // HbCacheHost and HbCachePath exist to supply cache host and path as targeting parameters diff --git a/openrtb_ext/request.go b/openrtb_ext/request.go index 9d1456c9618..25b5c881408 100644 --- a/openrtb_ext/request.go +++ b/openrtb_ext/request.go @@ -160,7 +160,7 @@ func (pg *PriceGranularity) UnmarshalJSON(b []byte) error { func PriceGranularityFromString(gran string) PriceGranularity { switch gran { case "low": - return priceGranulrityLow + return priceGranularityLow case "med", "medium": // Seems that PBS was written with medium = "med", so hacking that in return priceGranularityMed @@ -175,7 +175,7 @@ func PriceGranularityFromString(gran string) PriceGranularity { return PriceGranularity{} } -var priceGranulrityLow = PriceGranularity{ +var priceGranularityLow = PriceGranularity{ Precision: 2, Ranges: []GranularityRange{{ Min: 0, diff --git a/openrtb_ext/request_test.go b/openrtb_ext/request_test.go index 3291c4f9fb2..e4046a622db 100644 --- a/openrtb_ext/request_test.go +++ b/openrtb_ext/request_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" ) -// Test the unmashalling of the prebid extensions and setting default Price Granularity +// Test the unmarshalling of the prebid extensions and setting default Price Granularity func TestExtRequestTargeting(t *testing.T) { extRequest := &ExtRequest{} err := json.Unmarshal([]byte(ext1), extRequest) if err != nil { - t.Errorf("ext1 Unmashall falure: %s", err.Error()) + t.Errorf("ext1 Unmarshall failure: %s", err.Error()) } if extRequest.Prebid.Targeting != nil { t.Error("ext1 Targeting is not nil") @@ -22,7 +22,7 @@ func TestExtRequestTargeting(t *testing.T) { extRequest = &ExtRequest{} err = json.Unmarshal([]byte(ext2), extRequest) if err != nil { - t.Errorf("ext2 Unmashall falure: %s", err.Error()) + t.Errorf("ext2 Unmarshall failure: %s", err.Error()) } if extRequest.Prebid.Targeting == nil { t.Error("ext2 Targeting is nil") @@ -36,7 +36,7 @@ func TestExtRequestTargeting(t *testing.T) { extRequest = &ExtRequest{} err = json.Unmarshal([]byte(ext3), extRequest) if err != nil { - t.Errorf("ext3 Unmashall falure: %s", err.Error()) + t.Errorf("ext3 Unmarshall failure: %s", err.Error()) } if extRequest.Prebid.Targeting == nil { t.Error("ext3 Targeting is nil") diff --git a/pbsmetrics/metrics.go b/pbsmetrics/metrics.go index aea9735c276..cc836011efa 100644 --- a/pbsmetrics/metrics.go +++ b/pbsmetrics/metrics.go @@ -248,7 +248,7 @@ func RequestActions() []RequestAction { // MetricsEngine is a generic interface to record PBS metrics into the desired backend // The first three metrics function fire off once per incoming request, so total metrics -// will equal the total numer of incoming requests. The remaining 5 fire off per outgoing +// will equal the total number of incoming requests. The remaining 5 fire off per outgoing // request to a bidder adapter, so will record a number of hits per incoming request. The // two groups should be consistent within themselves, but comparing numbers between groups // is generally not useful. diff --git a/pbsmetrics/prometheus/prometheus.go b/pbsmetrics/prometheus/prometheus.go index 7cb80643542..e2b646d5238 100644 --- a/pbsmetrics/prometheus/prometheus.go +++ b/pbsmetrics/prometheus/prometheus.go @@ -76,7 +76,7 @@ const ( // NewMetrics initializes a new Prometheus metrics instance with preloaded label values. func NewMetrics(cfg config.PrometheusMetrics) *Metrics { requestTimeBuckets := []float64{0.05, 0.1, 0.15, 0.20, 0.25, 0.3, 0.4, 0.5, 0.75, 1} - cacheWriteTimeBuckts := []float64{0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1} + cacheWriteTimeBuckets := []float64{0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1} priceBuckets := []float64{250, 500, 750, 1000, 1500, 2000, 2500, 3000, 3500, 4000} metrics := Metrics{} @@ -112,7 +112,7 @@ func NewMetrics(cfg config.PrometheusMetrics) *Metrics { "prebidcache_write_time_seconds", "Seconds to write to Prebid Cache labeled by success or failure. Failure timing is limited by Prebid Server enforced timeouts.", []string{successLabel}, - cacheWriteTimeBuckts) + cacheWriteTimeBuckets) metrics.requests = newCounter(cfg, metrics.Registry, "requests", diff --git a/pbsmetrics/prometheus/prometheus_test.go b/pbsmetrics/prometheus/prometheus_test.go index 4cf9676e1d4..f76480f0852 100644 --- a/pbsmetrics/prometheus/prometheus_test.go +++ b/pbsmetrics/prometheus/prometheus_test.go @@ -571,7 +571,7 @@ func TestAdapterRequestMetrics(t *testing.T) { var totalCount float64 var totalCookieNoCount float64 var totalCookieYesCount float64 - var totalCookieUnknowmCount float64 + var totalCookieUnknownCount float64 var totalHasBidsCount float64 processMetrics(m.adapterRequests, func(m dto.Metric) { isMetricForAdapter := false @@ -597,7 +597,7 @@ func TestAdapterRequestMetrics(t *testing.T) { case string(pbsmetrics.CookieFlagYes): totalCookieYesCount += value case string(pbsmetrics.CookieFlagUnknown): - totalCookieUnknowmCount += value + totalCookieUnknownCount += value } } } @@ -606,7 +606,7 @@ func TestAdapterRequestMetrics(t *testing.T) { assert.Equal(t, test.expectedCount, totalCount, test.description+":total") assert.Equal(t, test.expectedCookieNoCount, totalCookieNoCount, test.description+":cookie=no") assert.Equal(t, test.expectedCookieYesCount, totalCookieYesCount, test.description+":cookie=yes") - assert.Equal(t, test.expectedCookieUnknownCount, totalCookieUnknowmCount, test.description+":cookie=unknown") + assert.Equal(t, test.expectedCookieUnknownCount, totalCookieUnknownCount, test.description+":cookie=unknown") assert.Equal(t, test.expectedHasBidsCount, totalHasBidsCount, test.description+":hasBids") } } diff --git a/router/aspects/request_timeout_handler_test.go b/router/aspects/request_timeout_handler_test.go index b6e10fd64bf..5283d5d51e7 100644 --- a/router/aspects/request_timeout_handler_test.go +++ b/router/aspects/request_timeout_handler_test.go @@ -1,12 +1,13 @@ package aspects import ( - "github.com/julienschmidt/httprouter" - "github.com/prebid/prebid-server/config" "net/http" "net/http/httptest" "testing" + "github.com/julienschmidt/httprouter" + "github.com/prebid/prebid-server/config" + "github.com/stretchr/testify/assert" ) @@ -18,7 +19,7 @@ func TestAny(t *testing.T) { reqTimeInQueue string reqTimeOut string setHeaders bool - extectedRespCode int + expectedRespCode int expectedRespCodeMessage string expectedRespBody string expectedRespBodyMessage string @@ -28,7 +29,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "6", reqTimeOut: "5", setHeaders: true, - extectedRespCode: http.StatusRequestTimeout, + expectedRespCode: http.StatusRequestTimeout, expectedRespCodeMessage: "Http response code is incorrect, should be 408", expectedRespBody: "Queued request processing time exceeded maximum", expectedRespBodyMessage: "Body should have error message", @@ -38,7 +39,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "0.9", reqTimeOut: "5", setHeaders: true, - extectedRespCode: http.StatusOK, + expectedRespCode: http.StatusOK, expectedRespCodeMessage: "Http response code is incorrect, should be 200", expectedRespBody: "Executed", expectedRespBodyMessage: "Body should be present in response", @@ -48,7 +49,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "", reqTimeOut: "", setHeaders: false, - extectedRespCode: http.StatusOK, + expectedRespCode: http.StatusOK, expectedRespCodeMessage: "Http response code is incorrect, should be 200", expectedRespBody: "Executed", expectedRespBodyMessage: "Body should be present in response", @@ -58,7 +59,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "2", reqTimeOut: "", setHeaders: true, - extectedRespCode: http.StatusOK, + expectedRespCode: http.StatusOK, expectedRespCodeMessage: "Http response code is incorrect, should be 200", expectedRespBody: "Executed", expectedRespBodyMessage: "Body should be present in response", @@ -68,7 +69,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "test1", reqTimeOut: "test2", setHeaders: true, - extectedRespCode: http.StatusInternalServerError, + expectedRespCode: http.StatusInternalServerError, expectedRespCodeMessage: "Http response code is incorrect, should be 400", expectedRespBody: "Request timeout headers are incorrect (wrong format)", expectedRespBodyMessage: "Body should have error message", @@ -78,7 +79,7 @@ func TestAny(t *testing.T) { reqTimeInQueue: "test1", reqTimeOut: "123", setHeaders: true, - extectedRespCode: http.StatusInternalServerError, + expectedRespCode: http.StatusInternalServerError, expectedRespCodeMessage: "Http response code is incorrect, should be 400", expectedRespBody: "Request timeout headers are incorrect (wrong format)", expectedRespBodyMessage: "Body should have error message", @@ -87,7 +88,7 @@ func TestAny(t *testing.T) { for _, test := range testCases { result := ExecuteAspectRequest(t, test.reqTimeInQueue, test.reqTimeOut, test.setHeaders) - assert.Equal(t, test.extectedRespCode, result.Code, test.expectedRespCodeMessage) + assert.Equal(t, test.expectedRespCode, result.Code, test.expectedRespCodeMessage) assert.Equal(t, test.expectedRespBody, string(result.Body.Bytes()), test.expectedRespBodyMessage) } } diff --git a/ssl/ssl_test.go b/ssl/ssl_test.go index c4c29d149ef..b72fb7ae9a3 100644 --- a/ssl/ssl_test.go +++ b/ssl/ssl_test.go @@ -38,7 +38,7 @@ func TestCertsFromFilePoolDontExist(t *testing.T) { // Assert loaded certificates by looking at the length of the subjects array of strings assert.NoError(t, err, "Error thrown by AppendPEMFileToRootCAPool while loading file %s: %v", certificatesFile, err) subjects := certPool.Subjects() - assert.Equal(t, len(subjects), 1, "We only loaded one vertificate from the file, len(subjects) should equal 1") + assert.Equal(t, len(subjects), 1, "We only loaded one certificate from the file, len(subjects) should equal 1") } func TestAppendPEMFileToRootCAPoolFail(t *testing.T) {