#Better Cloud Tests š§µ
1 messages Ā· Page 1 of 1 (latest)
@dawn ether there are standard semconv attributes we can use now: https://opentelemetry.io/docs/specs/semconv/registry/attributes/test/
I'm adding support for it in testctx now
Test Attributes This group describes attributes specific to software tests.
Attributes:
Key Stability Value Type Description Example Values test.case.name string The fully qualified human readable name of the test case. org.example.TestCase1.test1; example/tests/TestCase1.test1; ExampleTestCase1_test1 test.case.result.status string The status of...
the attributes are kind of dumb tbh. i don't know why suite has such expressive ending states, but case is just pass/fail. I decided to just use suite for that, but still set case name. 
nailed it
How does Dagger determine if something is a test? I would still rate the addition of a +test that produced some really basic junit output (function name, pass/fail, execution duration)
The UI recognizes the test.case.name span attribute referenced above, and uses presence of those spans as a strong hint for the UI to show a simplified list of the tests, instead of a raw trace. We'll support JUnit too, probably by just re-emitting it as OTel spans. Beyond trivial UI stuff, @warm seal is also cooking up some plans for how tests are represented in the DAG, to support test splitting / reruns / etc. in a nice consistent way
@rough glen are those standard spans that test tooling may already be emitting? Or our own invention?
(the otel stack is so sprawling, I wouldn't be surprised if a committee somewhere already formalized attributes)
standard š - they must have added them recently ish, they didn't exist when testctx was created
They're vibe-standardizing
Nice nice
That opens the possibility of open compat bridges between junit and otel then?
In either direction
yeah true
quick PR to get our test suites emitting better data: https://github.com/dagger/dagger/pull/12908
cloud UI PR, still iterating: https://github.com/dagger/dagger.io/pull/4892
preview: https://better-tests-v3.preview.dagger.cloud/dagger/checks/github.com/dagger/dagger@df7b8d614062895b03bf3422db1a4834d458a1fa?check=test-split%3Atest-modules&test=TestModule%2FTestConstructor%2Fbasic%2Ftypescript&viewMode=tests
Amazing š
If you're starting to think about grouping tests over time (for analytics, flake detection etc), I have useful architectural scaffolding for you , the design docs are far along enough to be worth reading.
Between those two, you get stable coordinate system to locate the span-emitting object, across time, workspaces, and even across schema-path changes
I'm most curious how the idea of a coordinate system informs web UI. Examples of things that have coordinates: SQL rows... spreadsheet rows... We're in familiar territory for web dev; tables, lists, filters, etc.
Also: I think a TUI equivalent of "test view" would be amazing for local dev loop š
https://asciinema.org/a/904712
Found a zero-config way to do go test => OTel š
Went through a few iterations, best option came down to a drop-in go test replacement, otelgotest. Tries to be even more transparent than gotestsum which takes a similar approach but has its own set of flags and needs -- to disambiguate. otelgotest on the other hand is as close to a pass-through as possible.
More details: https://github.com/dagger/otel-go/pull/2
Wow that's huge!
Here's how those two runs look in the test UI:
- https://better-tests-v3.preview.dagger.cloud/dagger/traces/d51c26cbf364efaaa011ebc9adf93226?test=TestBooklit&viewMode=tests
- https://better-tests-v3.preview.dagger.cloud/dagger/traces/6f98aa3dbff2859e00b0385a3065ed02?test=TestDang&viewMode=tests
Still lots of room to improve, gonna try to get something shipped before I fly out Friday
ah weird, same for me. as a workaround you can toggle between the Trace and Tests UI
tried to repro the org switcher issue by swapping to my org and clicking the link, but couldn't. (it does say 'viewing' but switches OK)
there's some known jank with the url handling already so hopefully whatever demon is lurking there gets exorcised along the way
@normal basin @swift eagle could use a ā
on https://github.com/dagger/otel-go/pull/2 - I rebased it on top of the otel bump, and it's all additive so shouldn't break anything. My plan is to eventually integrate this with dagger/go around here so Go tests automatically get emitted as OTel.