gradle/gradle-profiler

Strings written into Chrome trace JSON output are not escaped properly

quijote opened this issue · 1 comments

gradle-profiler did not produce valid JSON when I ran it with --profile chrome-trace on one of my builds. Specifically the "name" property contained special characters like " and new lines that were not escaped. The result is invalid JSON that Chrome can't parse.

Also faced this, in my case caused by parameterized tests.

As a workaround I quickly edited the output file with ripgrep, but it would be nice if it was handled by default.

rg '"name": "(".+?)", "cat"' -r '"name": "rename-me-test", "cat"' bad_file.json > fixed_file.json