-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add CLI out-dir option and rename env var #23
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
Conversation
README.md
Outdated
| * if you pass `CODETRACER_RUBY_TRACER_DEBUG=1`, you enables some additional debug-related logging | ||
| * `CODETRACER_DB_TRACE_PATH` can be used to override the path to `trace.json` (it's used internally by codetracer as well) | ||
| * `CODETRACER_RUBY_RECORDER_OUT_DIR` can be used to specify the directory for trace files | ||
| (used internally by codetracer as well; defaults to the current directory) |
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.
it's not used internally: is this connected to a codetracer PR?
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.
It was renamed to establish consistency with the CLI option name and to define a convention that we can use in all future recorder projects (e.g. the Python recorder will use CODETRACER_PYTHON_RECORDER_OUT_DIR)
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.
makes sense. a single variable is easier to maintain, but maybe this way it's more recorder/user-friendly indeed
src/trace.rb
Outdated
|
|
||
| trace_args = ARGV | ||
| ARGV = ARGV[1..-1] | ||
| trace_args = [program] + ARGV |
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.
does this work? it was important to override ARGS, if the user program uses it directly IIRC
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.
ok, sorry: ARGV.shift does it now , however if we have more args like -o, maybe we need to move past them as well(but i assume order! does that)
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.
The tests pass, so it should work :)
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.
they don't seem to test for ARGV usage
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.
Right, I'll add such test in a follow-up PR.
| # or in the folder of `$CODETRACER_DB_TRACE_PATH` if such an env var is defined | ||
| ruby trace.rb [--out-dir DIR] <path to ruby file> | ||
| # produces several trace json files in DIR, | ||
| # or in `$CODETRACER_RUBY_RECORDER_OUT_DIR` if DIR is not provided. |
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 requires a reform/additional support in codetracer
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.
OK, make the necessary changes on CodeTracer's side once you bump the version of the ruby-recorder.
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.
ok, we can do that. if we decide to directly produce codetracer archives, maybe this can be changed to _OUT_PATH but it's not clear yet
2fad6cd to
20335a7
Compare
Summary
--out-diroption for tracer utilitiesCODETRACER_RUBY_RECORDER_OUT_DIRor current dirTesting
just testjust benchjust build-extension