-
Notifications
You must be signed in to change notification settings - Fork 256
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
Improve PA API debugging capabilities #871
Comments
FWIW, the flags that can be used to develop web platform tests with Chrome can be of some use here; that setup uses something like: You can use these sort of resolver rules w/the appropriate hostnames rather than *.test to direct adtech.com towards 127.0.0.1, and then --ignore-certificate-errors will make Chrome not care about the certificate. |
Fabian, it sounds like Maks's comment about Beyond that, are |
Oh, also we do think we "allow output to the Chrome console from inside the bidding script"! Please let us know if you find that's not working. |
@morlovich Many thanks for those flags. We will definitely try those out. It would be nice if it can unlock some of our tests.
yes it should normally
yes it could be sufficient. It would be nice also to make an exception for IG domain checks on localhost such that we can patch the bidding script in the local InterestGroups DB as described and override the urls for
OK. Indeed. I wasn't aware console logs already work in Chrome. Actually it seems like it only doesn't work in Chromedriver and as this ticket is about integration tests it is still relevant. This has already been reported here: #499
|
Chiming in from Google Ads testing perspective, you may find it helpful to route all Chrome traffic to a proxy that can serve local or faked versions of the different servers, or leak to production if complete hermeticism isn't strictly necessary. +1 to the ask for Also +1 to a debugging flag to remove downsampling of |
Hmm. So I suspect the reason console.log may have stopped working for you is because I removed our hand-rolled minimal implementation in M100 (hit stable Tue, Mar 29, 2022 --- does the timing feel vaguely right), and now it works exactly the same as console.log does everywhere (using V8's devtools support). Maybe Chromedriver doesn't hook that up for worklet targets, though. It does seem to be doing stuff based on it, at least: Do you have to do anything special to get the console.log stuff from the top-level? |
@morlovich It bypasses the checks to require a valid certificate and CA checks indeed. However I still need to deploy my server with a TLS certificate and call a HTTPS domain.
Is it complicated on your side to solve this to allow localhost ? |
No I start chromedriver with |
@morlovich Any news on not seeing The issue is still there and it is not viable to set up manual test pages in Chrome for everything and debug everything with Devtools. At some point when complexity increases automatic tests need to be done. |
Thanks for the reminder. I spent some time debugging this, and I think it just doesn't include console.log due to default browser logging setting being warning or higher. So possible solutions are:
(It's possible that for other uses it somehow gets picked via roundabout way despite the log level). |
@morlovich Both of the options that you suggest don't work. I was actually already running my scripts with the setting
The issue is really that the logs (whatever their level) from inside the worklets don't show up in Chromedriver. Logs from the normal JS context, like what happens before and after |
Oh. I think I spent a bunch time debugging why a console-api message wasn't showing up while not realizing it was coming from the main page rather than the worklet. My apologies, I'll get back to you in a bit. |
OK, I can confirm the problem and I understand why it's happening (basically ChromeDriver isn't paying attention to auction_worklet targets at all, though it does get attached/detached to/from them); sadly not a straightforward thing to fix, but also not something fundamentally difficult --- it's just not somethings things are well setup to handle. |
OK. Thanks for the investigation. |
@morlovich I was curious if you were aware of another bug in DevTools > Console from PA script runners, where (unserialized) JS objects are logged normally but are frozen/unexpandable once the auction concludes and script runners are disposed. This makes it a fairly inconvenient to log and explore browserSignals in DevTools, for example. |
@morlovich Any update on this ? it looks really something with no privacy implications that could be fixed by Chrome. What is blocking on your side ? |
forDebuggingOnly
endpoints are very useful to debug client side Javascript code. It has been recently announced to keep them available in a heavily sampled mode which will be very useful for monitoring.Due to the limited number of received events (around 5k per day) it still makes sense to be able to have a solution to be able to debug more data. A complementary solution could be to activate those endpoints in Debug mode in a local Chrome browser and randomly explore observed real interest group taggings and real auctions (without knowing the exact user journey as this is not possible anymore).
Integration tests
Here is a documented example on how integration tests could be executed with Chromedriver & Selenium: https://github.com/RTBHOUSE/chromium-fledge-tests
Those tests could be executed on:
Sample workflow
Some sample workflow to achieve the random user journey could be to:
Current restriction: IG owner will be the endpoint hosted on https://adtech.com, all endpoints like
biddingLogicURL
must be hosted on this domainCall a locally hosted test publisher page with real collected
perBuyerSignals
(as there is currently no constraint that the seller must also own the publisher domain)forDebuggingOnly.reportAdAuctionWin
&forDebuggingOnly.reportAdAuctionLoss
, in this workflow they will be sent to https://adtech.com. As it is end to end encrypted with HTTPS it is hard to intercept those calls even with some proxyWe would like to collect the calls to
forDebuggingOnly.reportAdAuctionWin
&forDebuggingOnly.reportAdAuctionLoss
locally (console, file, ..) or at least on a webserver running on localhostAs of now we would need to patch the interest group in InterestGroup DB to expose a dedicated bidding script that calls the debug endpoint on https://localhost/ or some hosted server https://adtech1.com with a real certificate
Chromium debug features that could potentially unlock or simplify this use case
biddingLogicURL
on a domain like https://localhost/my_bidding_logic it will not work because domain must be the same as the IG owner domain (https://adtech.com)The text was updated successfully, but these errors were encountered: