-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lntest: add a flag to export data generated during the test #9947
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
lntest: add a flag to export data generated during the test #9947
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3acd704
to
1073c52
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.
Great idea, will definitely be useful when debugging.
In tapd
we just added a -nodelete
flag that works similar to the SkipCleanup
, then we can just examine the data in the temporary directory.
But specifying another base directory might be helpful as well, to separate folders from separate runs.
lntest/node/config.go
Outdated
@@ -28,6 +29,10 @@ const ( | |||
) | |||
|
|||
var ( | |||
// baseDirFlag is the default directory where all the node's data are | |||
// saved. If not set, a temporary dir will be created. | |||
baseDirFlag = flag.String("basedir", ".", "default dir to save data") |
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.
Setting "."
here will mean it will never be ""
, so a temp directory is never used.
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.
Nice catch! It didn't cause an issue before, I guess it's due to the default setting here BASE_DIR = ""
, otherwise it would have been caught😅
1073c52
to
eaf3b74
Compare
dccfb58
to
3a3cf31
Compare
lntest/node/config.go
Outdated
} | ||
|
||
// Use customized base dir and skip the cleanups. | ||
cfg.BaseDir = fmt.Sprintf("%s/%s", *baseDirFlag, dirBaseName) |
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.
filepath.Join(*baseDirFlag, dirBaseName)
?
This handles path separators correctly across OSes (e.g., /
vs \
), and avoids accidental double slashes.
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.
nice catch!
3a3cf31
to
3b84088
Compare
Add a new param
basedir
so we can save the node files and analyze them when needed, sth like,make itest icase=$icase basedir="your_customized_dir"
which gives,
Which is what I used to analyze SQL tables.