Skip to content
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

feature(backend): adding analytics events for test run checkpoints #2375

Merged
merged 1 commit into from Apr 13, 2023

Conversation

xoscar
Copy link
Collaborator

@xoscar xoscar commented Apr 12, 2023

This PR adds analytics events for the checkpoints that end a test run execution

Changes

  • Adding analytics events at the different levels where a test run ends

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

@xoscar xoscar added the backend label Apr 12, 2023
@xoscar xoscar self-assigned this Apr 12, 2023
@xoscar xoscar linked an issue Apr 12, 2023 that may be closed by this pull request
@xoscar xoscar marked this pull request as ready for review April 12, 2023 22:51
@@ -122,7 +123,12 @@ func (e *defaultAssertionRunner) runAssertionsAndUpdateResult(ctx context.Contex
log.Printf("[AssertionRunner] Test %s Run %d: fail to emit TestSpecsRunError event: %s\n", request.Test.ID, request.Run.ID, anotherErr.Error())
}

return model.Run{}, e.updater.Update(ctx, run.AssertionFailed(err))
run = run.AssertionFailed(err)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to find a single place where we finished a test run no matter the outcome, but I didn't find it, it feels that wherever the error is found we are just updating the required fields.

I know that the run.go model has a Finish method but it didn't feel right to execute an analytics event from a model.

We need to consider having a single spot to finish a test run that is not the model where we could execute side effects in the future, and not having to scatter the logic across these files.

@xoscar xoscar merged commit 2d92e45 into main Apr 13, 2023
28 checks passed
@xoscar xoscar deleted the 2245-error-handling-analytics-events-update branch April 13, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Error Handling] Analytics Events Update
3 participants