sourcecred/sharness
Dandelion Mané 88f736d180
add `sourcecred/scores` (#1223)
The scores are lightly processed from their internal representation.
Example usage:

```
$ yarn backend;
$ node bin/sourcecred.js load sourcecred/sourcecred
$ node bin/sourcecred.js scores sourcecred/sourcecred > scores.json
```

The data structure is as follows:

```js
export type NodeOutput = {|
  +id: string,
  +totalCred: number,
  +intervalCred: $ReadOnlyArray<number>,
|};

export type ScoreOutput = Compatible<{|
  +users: $ReadOnlyArray<NodeOutput>,
  +intervals: $ReadOnlyArray<Interval>,
|}>;
```

Test plan: I added sharness tests at `sharness/test_cli_scores.t`.
In the past, we've used javascript tests for CLI commands. However,
those are pretty time-consuming to write, and are less robust than
simply running the command from bash. Check the snapshot for a sense of
what the new data format looks like. Also, the snapshot updater now
updates this snapshot too.

Relevant for #1047.
Thanks to @Beanow for feedback on the output format and design.
Thanks to @wchargin for help in code review.
2019-07-14 17:05:13 +01:00
..
__snapshots__ add `sourcecred/scores` (#1223) 2019-07-14 17:05:13 +01:00
.gitignore Add a `.gitignore` for Sharness (#673) 2018-08-15 16:31:00 -07:00
Makefile Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
SHARNESS_LICENSE Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
aggregate-results.sh Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
dummy.t Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
sharness.sh Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
test_build_static_site.t fix sharness/test_build_static_site.t 2019-07-11 19:12:41 +01:00
test_cli_scores.t add `sourcecred/scores` (#1223) 2019-07-14 17:05:13 +01:00
test_js_tests_have_top_level_describe_block_with_filename.t Disable the Git plugin 2019-07-09 19:40:17 +01:00
test_load_example_github.t Add a universal snapshot updater (#1159) 2019-05-28 18:59:50 +03:00