equinix-labs / equinix-labs/otel-cli

make integration tests support checking more than one span of output

Open
#86 1 comment 0 reactions 0 assignees View on GitHub
bug testing
Dominant language
Go
Stars
716
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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:
```js
[
{
"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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.