open-telemetry / build-tools

Building tools provided by OpenTelemetry
https://opentelemetry.io
Apache License 2.0
37 stars 54 forks source link

Semantic convention generator: Clean up tests using separate input files #63

Open Oberon00 opened 3 years ago

Oberon00 commented 3 years ago

Many tests that use separate input files are not written very cleanly. The most important points:

Further ideas, not as important:

Oberon00 commented 2 years ago

See also https://github.com/open-telemetry/build-tools/pull/79#discussion_r851360604:

These tests are not designed as integration tests, they are targeted feature tests and it makes no sense to drag in a full spec yaml. These tests should instead use a minimal yaml that just uses group foo with attribute bar instead of actual data. See https://github.com/open-telemetry/build-tools/issues/63.

Having tests that automatically pull in spec code would additionally make sense, but then we don't have e.g. a testMultipleEnum or testRef but instead a testGeneratorIsSpecCompatible (and you'd need to think about how to design the build/change process so that you can also change the output in "incompatible" ways, e.g. temporarily reference a spec PR branch that updates the spec so the semconv table check is in sync again).