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

#156: truncate text on the left by default, but make it configurable #157

Merged
merged 7 commits into from
Feb 2, 2020

Conversation

itamarst
Copy link
Contributor

Fixes #156.

I tested the flag manually, but suggestions for additional automated tests are welcome.

@jonhoo
Copy link
Owner

jonhoo commented Jan 25, 2020

This looks good to me! Could you add a small test case for this too?

@itamarst
Copy link
Contributor Author

One of the "read this file in, get this file out" kinda tests?

@itamarst
Copy link
Contributor Author

That is, should it be the style of test in tests/flamegraph.rs, or something else? If the latter, what would it assert?

@jonhoo
Copy link
Owner

jonhoo commented Jan 26, 2020

Yup, a read-in check-out test seems great for this!

@itamarst
Copy link
Contributor Author

So I actually have to go and regenerate all the flamegraph SVGs in the integration tests, since they no longer match checked-in output... is there a utility to do that?

@jonhoo
Copy link
Owner

jonhoo commented Jan 26, 2020

Ah, because you changed the default I suppose. I don't think so, but @jasonrhansen might have something handy? An alternative is to make the test suite continue to run with cropping on the right, and then just add one test that does cropping on the left.

@jasonrhansen
Copy link
Collaborator

If you delete the flamegraph SVGs, the tests will recreate them for you. You could do this, then git diff and make sure the new SVGs match the originals except for the truncation.

@itamarst
Copy link
Contributor Author

itamarst commented Feb 2, 2020

Ok, I have:

  1. Updated existing tests.
  2. Added a new test.

@codecov
Copy link

codecov bot commented Feb 2, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@f299685). Click here to learn what that means.
The diff coverage is 79.16%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #157   +/-   ##
=========================================
  Coverage          ?   88.53%           
=========================================
  Files             ?       16           
  Lines             ?     2216           
  Branches          ?        0           
=========================================
  Hits              ?     1962           
  Misses            ?      254           
  Partials          ?        0
Impacted Files Coverage Δ
src/collapse/perf.rs 97.39% <ø> (ø)
src/collapse/dtrace.rs 89.8% <ø> (ø)
src/flamegraph/color/mod.rs 73.04% <100%> (ø)
src/differential/mod.rs 98.38% <100%> (ø)
src/flamegraph/attrs.rs 91.91% <100%> (ø)
src/collapse/common.rs 61.11% <70.58%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f299685...d2d2695. Read the comment docs.

@jonhoo jonhoo merged commit 730217d into jonhoo:master Feb 2, 2020
@jonhoo
Copy link
Owner

jonhoo commented Feb 2, 2020

Looks great to me, thanks!
Oh, could you please also submit a PR that updates CHANGELOG.md to point to these changes under "Unreleased"?

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.

Cut off left part of text, rather than right part of text when SVG is too small
3 participants