Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JSON tests ignore expected message field #1450

Merged
merged 36 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
790e903
step out real quick
Jul 20, 2020
a897627
Merge branch 'master' into issue1406
Jul 23, 2020
199dfd0
Merge branch 'master' into issue1406
Aug 6, 2020
010a24a
stteping out real quick
Aug 11, 2020
5de98d7
Merge branch 'master' into issue1406
Aug 12, 2020
5a86d24
Most tests pass
Aug 15, 2020
f7f6ec2
passing all tests
Aug 16, 2020
26a6b7a
Corrected files in aliases dir
Aug 17, 2020
abceda9
Remove unused code
Aug 17, 2020
04a202a
Remove unused json files in endpoints/openrtb2/sample-requests/valid-…
Aug 17, 2020
7e5001f
Implementing both unmarshall and JSONparser
Aug 20, 2020
02d5d0d
rolled back to jsonparser
Aug 21, 2020
b3cc6c5
Merge branch 'master' into issue1406
Aug 21, 2020
04da91e
Last refactor
Aug 21, 2020
552eaf0
feedback part 1
Sep 2, 2020
1729e48
Updated with latest master
Sep 2, 2020
7ac73fa
feedback part 2
Sep 3, 2020
ab8a9bc
feedback part 3
Sep 13, 2020
cdb3c79
Updated latest master
Sep 14, 2020
b6f85f4
Update again because local master wasn't up to date
Sep 14, 2020
2596232
Scott's second feedback part 1
Sep 23, 2020
43cfba9
first feedback part 4
Sep 24, 2020
1427fa1
Stepping out quick
Sep 24, 2020
631f174
Scott's second feedback part 2
Sep 25, 2020
f0ba2b1
Merge branch 'master' into issue1406
Sep 25, 2020
532306f
Merge branch 'master' into issue1406
Sep 25, 2020
d3d8140
Discontinued use of gojsondiff because of bug
Sep 25, 2020
14ed85c
Scott's third review
Oct 5, 2020
6a90e5e
Scott's third review part two
Oct 7, 2020
b5dfb19
assert.NoError(...) conditional error. Good catch Mansi
Oct 13, 2020
e8e8a5b
Remove unnecessary TestDisabledBidder test
Oct 14, 2020
4250c45
update
Oct 17, 2020
93c5c92
Mansi's feedback
Oct 26, 2020
1aae48c
Removed vim's swp file
Oct 27, 2020
eeb4500
test file path string correction
Oct 28, 2020
cc326b7
Mansi's second feedback
Oct 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
554 changes: 261 additions & 293 deletions endpoints/openrtb2/auction_test.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"description": "This request comes with no account id and the mock config does not make it a requirement",
"mockConfig": {
"accountRequired": false
},
"mockBidRequest": {
"id": "some-request-id",
"site": {
"page": "test.somepage.com"
},
"user": { },
"imp": [
{
"id": "my-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 600
}
]
},
"pmp": {
"deals": [
{
"id": "some-deal-id"
}
]
},
"ext": {
"appnexus": {
"placementId": 12883451
}
}
}
],
"tmax": 500,
"ext": {
"prebid": {
"aliases": {
"districtm": "appnexus"
},
"bidadjustmentfactors": {
"appnexus": 1.01,
"districtm": 0.98,
"rubicon": 0.99
},
"cache": {
"bids": {}
},
"targeting": {
"includewinners": false,
"pricegranularity": {
"precision": 2,
"ranges": [
{
"max": 20,
"increment": 0.10
}
]
}
}
}
}
},
"expectedBidResponse": {
"id":"some-request-id",
"bidid":"test bid id",
"nbr":0
},
"expectedReturnCode": 200
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"description": "This request comes with no account id and the mock config requires it. We expect an error",
"mockConfig": {
"accountRequired": true
},
"mockBidRequest": {
"id": "some-request-id",
"site": {
"page": "test.somepage.com"
},
"user": { },
"imp": [
{
"id": "my-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 600
}
]
},
"pmp": {
"deals": [
{
"id": "some-deal-id"
}
]
},
"ext": {
"appnexus": {
"placementId": 12883451
}
}
}
],
"tmax": 500,
"ext": {
"prebid": {
"aliases": {
"districtm": "appnexus"
},
"bidadjustmentfactors": {
"appnexus": 1.01,
"districtm": 0.98,
"rubicon": 0.99
},
"cache": {
"bids": {}
},
"targeting": {
"includewinners": false,
"pricegranularity": {
"precision": 2,
"ranges": [
{
"max": 20,
"increment": 0.10
}
]
}
}
}
}
},
"expectedReturnCode": 400,
"expectedErrorMessage": "Invalid request: Prebid-server has been configured to discard requests that don't come with an Account ID. Please reach out to the prebid server host.\n"
}
66 changes: 0 additions & 66 deletions endpoints/openrtb2/sample-requests/account-required/no-acct.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
SyntaxNode marked this conversation as resolved.
Show resolved Hide resolved
"description": "Account is required but request comes with a blacklisted account id",
"mockConfig": {
"accountRequired": true,
"blacklistedAccts": ["bad_acct"]
},
"mockBidRequest": {
"id": "some-request-id",
"user": {
"ext": {
"consent": "gdpr-consent-string",
"prebid": {
"buyeruids": {
"appnexus": "override-appnexus-id-in-cookie"
}
}
}
},
"app": {
"id": "cool_app",
"publisher": {
"id": "bad_acct"
}
},
"regs": {
"ext": {
"gdpr": 1
}
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"appnexus": {
"placementId": 12883451
},
"districtm": {
"placementId": 105
},
"rubicon": {
"accountId": 1001,
"siteId": 113932,
"zoneId": 535510
}
}
}
],
"tmax": 500,
"ext": {
"prebid": {
"aliases": {
"districtm": "appnexus"
},
"bidadjustmentfactors": {
"appnexus": 1.01,
"districtm": 0.98,
"rubicon": 0.99
},
"cache": {
"bids": {}
},
"targeting": {
"includewinners": false,
"pricegranularity": {
"precision": 2,
"ranges": [
{
"max": 20,
"increment": 0.10
}
]
}
}
}
}
},
"expectedReturnCode": 503,
"expectedErrorMessage": "Invalid request: Prebid-server has blacklisted Account ID: bad_acct, please reach out to the prebid server host.\n"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"description": "This request comes account id which is required in the config",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Incomplete grammer. Seems like it should be something like:
"This request comes with an account id and which is required by the config"

"mockConfig": {
"accountRequired": true
},

"mockBidRequest": {
"id": "some-request-id",
"site": {
"publisher": { "id": "not_bad_acct"},
"page": "test.somepage.com"
},
"user": { },
"imp": [
{
"id": "my-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 600
}
]
},
"pmp": {
"deals": [
{
"id": "some-deal-id"
}
]
},
"ext": {
"appnexus": {
"placementId": 12883451
}
}
}
],
"tmax": 500,
"ext": {
"prebid": {
"aliases": {
"districtm": "appnexus"
},
"bidadjustmentfactors": {
"appnexus": 1.01,
"districtm": 0.98,
"rubicon": 0.99
},
"cache": {
"bids": {}
},
"targeting": {
"includewinners": false,
"pricegranularity": {
"precision": 2,
"ranges": [
{
"max": 20,
"increment": 0.10
}
]
}
}
}
}
},
"expectedBidResponse": {
"id":"some-request-id",
"bidid":"test bid id",
"nbr":0
},
"expectedReturnCode": 200
}
Loading