make integration tests support checking more than one span of output
The current "span_data" check in the test fixtures only supports one span. That's a result of the way I originally wrote it for one span then expanded to multiple and haven't used it much. In working with @edw-eqix on some test PRs we realized this.
I think the JSON would end up looking like:
[
{
"expect": {
"output": "hello world\n",
"spans": 2,
"span_data": [
{
"trace_id": "edededededededededededededed9000",
"span_id": "*",
"is_sampled": "true"
},
{
"trace_id": "*",
"span_id": "*",
"is_sampled": "true"
}
]
}
}
]
So we have a list of spans to check instead of a single span hash.
A trick here is that technically spans can come into the server out of order. The simplest way forward for now is probably to call sort.Sort() on a CliEventList of spans. This will require a little refactoring and maybe extra work to make sure all spans are captured and passed back correctly.
Added multiple span support to otel-cli status in #227