-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add test run entity (no-changelog) #11832
base: ai-428-testrunner-kick-off-evaluation-workflow
Are you sure you want to change the base?
chore: Add test run entity (no-changelog) #11832
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
d4fe007
to
8f9f39e
Compare
|
completedAt: Date; | ||
|
||
@Column(jsonColumnType, { nullable: true }) | ||
metrics: IDataObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDataObject
is very problematic as it's basically a generic record and hence doesn't provide any type safety. Do we have some idea what these metrics are going to be? Let's preferably use a more precise type if possible. Or if it's not known we can use unknown
and then you have to parse/validate the type before using it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the POC we assume metrics will be a list of key:value pairs, where values would be numbers. We have rough idea of where it can develop over time, but you are right, we can narrow the type now and expand it later.
runAt: Date; | ||
|
||
@Column(datetimeColumnType) | ||
completedAt: Date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be nullable, right?
status: TestRunStatus; | ||
|
||
@Column(datetimeColumnType) | ||
runAt: Date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be nullable or is the test run created directly in the running
state?
status: 'new', | ||
}); | ||
|
||
await this.testRunRepository.save(testRun); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use insert
instead or does .save
update something behind the scenes that we need?
testRun.status = 'running'; | ||
testRun.runAt = new Date(); | ||
await this.testRunRepository.save(testRun); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very core business logic, and it would be nice to have it encapsulated somewhere as markAsRunning
method/function. One option would be in the TestRunRepository
@@ -208,9 +224,17 @@ export class TestRunnerService { | |||
console.log({ evalResult }); | |||
|
|||
// TODO: collect metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO still needed?
testRun.status = 'completed'; | ||
testRun.completedAt = new Date(); | ||
testRun.metrics = aggregatedMetrics; | ||
await this.testRunRepository.save(testRun); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Should be encapsulated as markAsCompleted
@@ -208,9 +224,17 @@ export class TestRunnerService { | |||
console.log({ evalResult }); | |||
|
|||
// TODO: collect metrics | |||
metrics.push(evalResult); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the intermediate result?
097f6fd
to
5e03e80
Compare
a499f0b
to
373430f
Compare
Summary
To store the status and results of each test run we need a new DB entity.
This PR:
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)