-
Notifications
You must be signed in to change notification settings - Fork 45
ci: if test core dumps, upload dump as build artifact #2906
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
base: v3.0-dev
Are you sure you want to change the base?
Conversation
WalkthroughThis change enhances the CI workflow by adding crash dump handling to test execution. The workflow configures the system to capture core dumps on test failure, collects related crash artifacts and binaries, and uploads them for debugging purposes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/tests-rs-package.yml (2)
201-206: Consider more restrictive permissions for /cores directory.While 777 permissions work in this CI container environment, it's overly permissive. Consider using 755 or 775 instead to follow the principle of least privilege.
Apply this diff to use more restrictive permissions:
- name: Configure core dumps run: | sudo mkdir /cores - sudo chmod 777 /cores + sudo chmod 755 /cores # Core filenames will be of the form executable.pid.timestamp: sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'
246-251: dSYM files are macOS-specific but workflow runs on Linux.The script collects
.dSYMfiles, which are macOS debug symbols, but this workflow runs onubuntu-24.04. While harmless, this check is unnecessary on Linux. The.dwpfiles are the appropriate debug symbol format for Linux.Apply this diff to remove unnecessary macOS-specific debug symbol handling:
- for extra in target/debug/deps/${BIN_PREFIX}-*.dSYM target/debug/${BIN_PREFIX}.dSYM \ - target/debug/deps/${BIN_PREFIX}-*.dwp target/debug/${BIN_PREFIX}.dwp; do + for extra in target/debug/deps/${BIN_PREFIX}-*.dwp target/debug/${BIN_PREFIX}.dwp; do if [[ -e "$extra" ]]; then cp -a "$extra" "${ARTIFACT_DIR}/binaries/" fi done
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/tests-rs-package.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: lklimek
Repo: dashpay/platform PR: 2318
File: .github/workflows/tests-build-image.yml:45-45
Timestamp: 2024-11-13T10:31:30.891Z
Learning: In the dashpay/platform repository, changes to `.github/workflows/tests-build-image.yml` that switch the Docker image platform from `linux/arm64` to `linux/amd64` for testing purposes are acceptable when required to run on GitHub-hosted runners. ARM64 testing is covered on the testnet.
📚 Learning: 2024-11-08T09:27:23.601Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2316
File: .github/actions/librocksdb/action.yaml:22-28
Timestamp: 2024-11-08T09:27:23.601Z
Learning: Prefer to use `librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }}` as the cache key for caching librocksdb in workflows; it's sufficient.
Applied to files:
.github/workflows/tests-rs-package.yml
🔇 Additional comments (2)
.github/workflows/tests-rs-package.yml (2)
209-211: LGTM!The ulimit configuration correctly enables unlimited core dump generation, which is essential for capturing crash information when tests fail.
255-264: LGTM!The artifact upload configuration is well-designed with appropriate retention period, graceful handling of missing files, and helpful usage documentation.
|
Don't we need something that cleans these up from time to time? |
Issue being fixed or feature implemented
When tests are killed, we want to be able to retrieve core dump and affected binary to investigate
What was done?
Extended test workflow to upload core dump and binary to github artifacts.
How Has This Been Tested?
https://github.com/dashpay/platform/actions/runs/20302691431
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Chores
✏️ Tip: You can customize this high-level summary in your review settings.