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

feat: write snapshot if try runtime check fails #4657

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

dandanlen
Copy link
Collaborator

@dandanlen dandanlen commented Mar 18, 2024

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.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72%. Comparing base (6bbb969) to head (8619558).
Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@dandanlen dandanlen force-pushed the feat/write-snapshot-on-try-runtime-failure branch 3 times, most recently from 828d7db to 56943bf Compare March 25, 2024 11:53
@dandanlen dandanlen force-pushed the feat/write-snapshot-on-try-runtime-failure branch 2 times, most recently from 8792c87 to 6560448 Compare April 3, 2024 10:00
@dandanlen dandanlen force-pushed the feat/write-snapshot-on-try-runtime-failure branch 2 times, most recently from 221aa10 to 330016d Compare April 8, 2024 13:55
@dandanlen dandanlen force-pushed the feat/write-snapshot-on-try-runtime-failure branch from 3844ac3 to b47363a Compare April 11, 2024 15:10
Copy link
Collaborator Author

@dandanlen dandanlen left a 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.

.github/workflows/upgrade-test.yml Show resolved Hide resolved
.github/workflows/upgrade-test.yml Show resolved Hide resolved
bouncer/commands/upgrade_network.ts Show resolved Hide resolved
const stderrOutput = fs.readFileSync(stderrFile, 'utf8');
console.error(e);
console.error('Command failed: Command output:', stderrOutput);
function createSnapshotFile(networkUrl: string, blockHash: string) {
Copy link
Collaborator Author

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) {
Copy link
Collaborator Author

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.

bouncer/shared/upgrade_network.ts Show resolved Hide resolved
bouncer/shared/upgrade_network.ts Show resolved Hide resolved
bouncer/shared/upgrade_network.ts Show resolved Hide resolved
bouncer/shared/upgrade_network.ts Show resolved Hide resolved
bouncer/shared/utils/exec_with_log.ts Outdated Show resolved Hide resolved
@dandanlen dandanlen marked this pull request as ready for review April 11, 2024 15:26
.github/workflows/upgrade-test.yml Outdated Show resolved Hide resolved
@dandanlen dandanlen merged commit 47b49e0 into main Apr 15, 2024
46 checks passed
@dandanlen dandanlen deleted the feat/write-snapshot-on-try-runtime-failure branch April 15, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants