-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: improvements to the test run events #2405
fix: improvements to the test run events #2405
Conversation
@@ -208,7 +208,7 @@ func (e *defaultAssertionRunner) emitFailedAssertions(ctx context.Context, req A | |||
} | |||
|
|||
if errors.Is(spanAssertionResult.CompareErr, expression.ErrInvalidSyntax) { | |||
e.eventEmitter.Emit(ctx, events.TestSpecsAssertionError( |
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.
Moving this from errors to warnings as these don't stop the test run
|
||
err = pe.eventEmitter.Emit(request.ctx, events.TraceFetchingStart(request.test.ID, request.run.ID)) | ||
if err != nil { | ||
log.Printf("[PollerExecutor] Test %s Run %d: failed to emit TraceFetchingStart event: error: %s\n", request.test.ID, request.run.ID, err.Error()) |
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.
Moving some events ideally this file should only trigger "polling" specific events
@@ -141,12 +141,14 @@ func (tp tracePoller) processJob(job PollingRequest) { | |||
} | |||
|
|||
if job.IsFirstRequest() { | |||
err := tp.eventEmitter.Emit(job.ctx, events.TracePollingStart(job.test.ID, job.run.ID)) |
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.
As main orchestrator, here we should trigger fetching trace events
<S.Column> | ||
<S.InfoIcon /> | ||
<div> | ||
<Typography.Title level={3}>Polling profile configuration:</Typography.Title> |
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.
Adding polling profile info
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.
Great! I've added two suggestions, do they make sense?
server/executor/poller_executor.go
Outdated
log.Printf("[PollerExecutor] Test %s Run %d: failed to emit TraceFetchingStart event: error: %s\n", request.test.ID, request.run.ID, err.Error()) | ||
err = pe.eventEmitter.Emit(request.ctx, events.TracePollingStart(request.test.ID, request.run.ID)) | ||
if err != nil { | ||
log.Printf("[PollerExecutor] Test %s Run %d: failed to emit TraceFetchingStart event: error: %s\n", request.test.ID, request.run.ID, err.Error()) |
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.
log.Printf("[PollerExecutor] Test %s Run %d: failed to emit TraceFetchingStart event: error: %s\n", request.test.ID, request.run.ID, err.Error()) | |
log.Printf("[PollerExecutor] Test %s Run %d: failed to emit TracePollingStart event: error: %s\n", request.test.ID, request.run.ID, err.Error()) |
server/executor/trace_poller.go
Outdated
@@ -123,7 +123,7 @@ func (tp tracePoller) Stop() { | |||
func (tp tracePoller) Poll(ctx context.Context, test model.Test, run model.Run) { | |||
log.Printf("[TracePoller] Test %s Run %d: Poll\n", test.ID, run.ID) | |||
|
|||
job := NewPollingRequest(ctx, test, run, 0) | |||
job := NewPollingRequest(ctx, test, run, 1) |
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.
Can we put this number as a constant on this file? Something like PollingRequestStartIteration
?
job := NewPollingRequest(ctx, test, run, 1) | |
job := NewPollingRequest(ctx, test, run, PollingRequestStartIteration) |
* fix: improvements to the test run events * PR comment updates
This PR adds several improvements to the events triggered by the BE when executing a test run
Changes
Fixes
Checklist
I Encourage you to take a look at the loom video
https://www.loom.com/share/9353520fe43c49c6897f26b45975c2c3