EvaluationTrait
A test trait that runs an evaluation and records the result as attachments.
Declaration
struct EvaluationTraitMentioned in
Overview
let accuracyMetric = Metric("Accuracy")
@Test(.evaluates(myEvaluation))
func testAccuracy() async throws {
let result = EvaluationContext.current.result
#expect(result.aggregateValue(.mean(of: accuracyMetric)) >= 0.8)
}The result is accessible from an evaluation context.