Skip to content

Rise: Add test mode param #4308

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SamuelRise
Copy link

@SamuelRise SamuelRise commented Apr 20, 2025

  • Add the test mode
  • Add some test and fix them

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, bf31125

rise

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/rise/rise.go:33:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:41:	MakeRequests		78.6%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:72:	MakeBids		88.9%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:109:	extractBidderParams	100.0%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:138:	getMediaTypeForBid	100.0%
total:								(statements)		90.9%

@SamuelRise SamuelRise changed the title Add test mode param Rise: Add test mode param Apr 20, 2025
@bsardo bsardo added the adapter label Apr 22, 2025
@bsardo bsardo self-assigned this Apr 24, 2025
@bsardo
Copy link
Collaborator

bsardo commented Apr 28, 2025

@pm-shriprasad-marathe can you please review?

Copy link
Contributor

@ShriprasadM ShriprasadM left a comment

Choose a reason for hiding this comment

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

@SamuelRise : Added my review comments
CC: @bsardo

for _, imp := range openRTBRequest.Imp {
var bidderExt adapters.ExtImpBidder
if err = jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil {
return "", fmt.Errorf("unmarshal bidderExt: %w", err)
return bidderParameters, fmt.Errorf("unmarshal bidderExt: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

@SamuelRise : Why there is a need to return empty reference &bidderParameters{}. Why can't we return nil instead?
In my opinion, we are creating unnecessary reference in memory

Copy link

Choose a reason for hiding this comment

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

@ShriprasadM thanks for the comment, fixed

@@ -5,4 +5,5 @@ type ImpExtRise struct {
PublisherID string `json:"publisher_id"`
Org string `json:"org"`
PlacementID string `json:"placementId"`
TestMode bool `json:"testMode"`
Copy link
Contributor

Choose a reason for hiding this comment

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

@SamuelRise : Being its impression level parameter, curious to understand how testEndpointURL and endpointURL will work in following scenario -

{
    "imp": [
        {
            "id": "imp_1",
            "ext": {
                "prebid": {
                    "bidder": {
                        "rise": {
                            "testMode": true
                        }
                    }
                }
            }
        },
        {
            "id": "imp_2",
            "ext": {
                "prebid": {
                    "bidder": {
                        "rise": {
                            "testMode": false
                        }
                    }
                }
            }
        }
    ]
}

Copy link

Choose a reason for hiding this comment

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

@ShriprasadM in this case we will check the first imp that will decide on whether to use "testMode"

Comment on lines +19 to +21
"testMode": {
"type": "boolean",
"description": "Test mode"
Copy link
Contributor

Choose a reason for hiding this comment

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

@SamuelRise : how req.test and this parameter will work together?

Copy link

Choose a reason for hiding this comment

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

@ShriprasadM we only decide through the 'testMode' parameter the end point url so not really sure what you mean

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, e5fabeb

rise

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/rise/rise.go:33:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:41:	MakeRequests		78.6%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:72:	MakeBids		88.9%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:109:	extractBidderParams	100.0%
github.com/prebid/prebid-server/v3/adapters/rise/rise.go:138:	getMediaTypeForBid	100.0%
total:								(statements)		90.9%

@SyntaxNode
Copy link
Contributor

Why is a "test mode" necessary? Testing should be performed on a non-prod or local instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants