Phabricator JSON Schema

#1

I want to use Phabricator to analyze my test results for my project. Since, we can get test results output in the form of json but i’m struggling it to convert it Phabricator JSON format because there is a custom format I guess. So, can anyone help me what is the Phabricator JSoN Schema or format? so that I can convert my test results to it.
Also, how can i upload those results to phabricator?

0 Likes

#2

The actual format of “Coverage” in Phabricator is documented here: https://secure.phabricator.com/book/phabricator/article/arcanist_coverage/
It looks like this:

{
  "src/example.php": "NNCNNNCNUNNNUNUNUNUNUNC",
  "src/other.php": "NNUNNNUNCNNNUNUNCNCNCNU"
}

and it’s part of the unit test result json.

You can upload it either during arc diff, by producing the right objects (see https://secure.phabricator.com/book/phabricator/article/arcanist_lint_unit/ which is a little out of date - use .arclint now), or in the CI - see https://secure.phabricator.com/book/phabricator/article/harbormaster/ for how to integrate with your CI server.

2 Likes

#3

Sorry for late reply.
So, what I figured out that Phabricator outputs the report in JSON Format and the output is in the form of array which contains key as filename and an associated value that is a string formed from 4 characters N,C,U, X
But I’m not getting how these 4 characters can help in providing necessary information like time factor, most frequent failing test etc.
please correct me if I’m wrong!
Also, does phabricator takes only php files as input?

0 Likes

#4

Coverage is part of unit tests results; These are sent in harbormaster.sendmessage, along with all the other information such as timing, success/fail, etc. This format is documented at https://secure.phabricator.com/conduit/method/harbormaster.sendmessage/.

There’s no support yet for analytics such as “most frequent failing test”.

The conduit data protocol is JSON.

0 Likes

#5

Oh I see, Thanks for help @avivey
Will get in touch soon, if i face any problems :slight_smile:

0 Likes

closed #6
0 Likes