mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(campaign): a record always says how many actions named no producer
An omitted count reads the same as a run recorded before actions carried a source, so the two cannot be told apart by anything downstream.
This commit is contained in:
1 parent
153f857431
commit
e0180f891a
2 files changed
+14
-6
No files matched your search
@@ -138,14 +138,19 @@ func TestRunCampaign_RecordsDispatchedActionsNotSteps(t *testing.T) {
|
||||
}
|
||||
|
||||
// A run that never produced a readable trace still has to carry the field, so
|
||||
// analysis can tell a zero-action run from a file written before the count.
|
||||
func TestRunRecord_AlwaysCarriesTheActionCount(t *testing.T) {
|
||||
// analysis can tell a zero-action run from a file written before the count. The
|
||||
// same holds for the unattributed count: a run whose every action named its
|
||||
// producer says so with a zero, and a file that says nothing is one recorded
|
||||
// before actions named one at all.
|
||||
func TestRunRecord_AlwaysCarriesTheActionCounts(t *testing.T) {
|
||||
body, err := json.Marshal(runRecord{Seed: 7, TraceError: "no run directory with meta.json"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(string(body), `"actions":0`) {
|
||||
t.Errorf("record %s omits the action count", body)
|
||||
for _, field := range []string{`"actions":0`, `"unattributed_actions":0`} {
|
||||
if !strings.Contains(string(body), field) {
|
||||
t.Errorf("record %s omits %s", body, field)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user