-
Notifications
You must be signed in to change notification settings - Fork 402
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
Blockscout scraping and use c8
instead of nyc
#1092
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## staging #1092 +/- ##
===========================================
+ Coverage 78.88% 85.60% +6.72%
===========================================
Files 56 67 +11
Lines 1539 8002 +6463
Branches 271 598 +327
===========================================
+ Hits 1214 6850 +5636
- Misses 189 1138 +949
+ Partials 136 14 -122
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
e5d8b4f
to
e792564
Compare
Since the new Blockscout uses client side rendering, we need a browser to scrape the page contents. Use puppeteer to scrape. Also update `txRegex` to be an array to support trying multiple regexes.
After adding `puppeteer` we started getting `cov_{id} is not defined` errors. This was caused by `nyc` which hasn't been updated in years. It would make sense to move to a more up-to-date coverage library. See istanbuljs/nyc#1327
e792564
to
592ab8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
c8
instead of nyc
Recently noticed one of the tests started failing where we were scaping the transaction hash from the block explorer. This is because the chain's (Gnosis) Blockscout has been updated with the new Blockscout UI. This caused both the regex to not work anymore, as well as not being able to load the page contents with a fetch because the new UI is client-side rendered.
Update the scraping to try multiple regex'es, both the one for the old and the new UI.
Uses
puppeteer
to load the page to be scraped. This required to install the puppeteer dependencies on the containers that are running Sourcify and CI containers running tests: https://app.circleci.com/pipelines/github/ethereum/sourcify/4300/workflows/49a22229-32c3-408a-8459-622ecd863762/jobs/23775Additionally we started getting
cov_{id} is not defined
errros in tests: https://app.circleci.com/pipelines/github/ethereum/sourcify/4309/workflows/35ad9ef7-524e-43b1-8ae5-4cf8d0455c65/jobs/23803 This was caused by thenyc
library which hasn't been updated for some time. Move toc8
instead for coverage which is more up-to-date. See istanbuljs/nyc#1327View in Huly HI-547