-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: write snapshot if try runtime check fails #4657
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4657 +/- ##
======================================
- Coverage 72% 72% -0%
======================================
Files 409 411 +2
Lines 70092 70144 +52
Branches 70092 70144 +52
======================================
- Hits 50807 50740 -67
- Misses 16855 16970 +115
- Partials 2430 2434 +4 ☔ View full report in Codecov by Sentry. |
828d7db
to
56943bf
Compare
8792c87
to
6560448
Compare
221aa10
to
330016d
Compare
3844ac3
to
b47363a
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.
I went through a lot of iterations so the commits ended up entirely unstructured. I've added comments to explain.
const stderrOutput = fs.readFileSync(stderrFile, 'utf8'); | ||
console.error(e); | ||
console.error('Command failed: Command output:', stderrOutput); | ||
function createSnapshotFile(networkUrl: string, blockHash: string) { |
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.
This is new.
); | ||
} | ||
|
||
function tryRuntimeCommand(runtimePath: string, blockHash: 'latest' | string, networkUrl: string) { |
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.
This is just refactored to use execWithRustLog
and write a snapshot if it fails.
This restructures some of the try-runtime tests and adds some utilities (see comments).
My main motivation for this was to write snapshots of failed runtime upgrade blocks so these can be downloaded for local debugging when something fails.
After trying for a long time to get nodeJS/github actions to output stderr to be able to read the try-runtime log, I finally gave but. But then I realised (quite late) that the try-runtime output is already visible in the chainflip-node logs! So I just added a notice to that effect when the try-runtime tests exit with an error.