google / pprof

pprof is a tool for visualization and analysis of profiling data
Apache License 2.0
8.03k stars 608 forks source link

Add tests for javascript code #791

Open Louis-Ye opened 1 year ago

Louis-Ye commented 1 year ago

Per @ghemawat from https://github.com/google/pprof/pull/790:

None of the javascript in pprof is tested.

One alternative is that we might need to install node in some github action and use that (maybe something like https://github.com/browser-actions/examples).

Another alternative would be to do manually triggered tests: if pprof is invoked with a special flag, it passes that to the javascript, and the javascript code when it sees that flag runs self tests. But it would be better to figure out how to have real tests.

Louis-Ye commented 1 year ago

https://github.com/google/pprof/pull/798 is addressing this issue.

ghemawat commented 1 year ago

Should we leave this issue as open until we cover most of the Javascript code with tests (the current state just exercises one small part - the sorting of the Top table)?

aalexand commented 1 year ago

Probably yes, we should keep it open - I would say at least until we have one happy-path test for each view and filtering feature.