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

k6runner/test: ensure logs are sent to loki when runner reports user errors #741

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

nadiamoe
Copy link
Member

@nadiamoe nadiamoe commented Jun 26, 2024

Doesn't actually fix, but related to grafana/synthetic-monitoring-app#835.

When running a script on a remote runner, roughly two kind of errors can occur:

  1. An error occurs reaching the remote runner, meaning that the script could not be scheduled. kan example of this can be network errors reaching our infra.
  2. The script was executed, and it returned an error. In this case the runner returns the k6 error log as a part of the response body.

This PR adds tests asserting that those errors in the response body (2) are sent to Loki regardless of the reported errorCode.

@nadiamoe nadiamoe requested a review from a team as a code owner June 26, 2024 11:33
Copy link
Contributor

@ka3de ka3de left a comment

Choose a reason for hiding this comment

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

The modifications to the test look good! Just made a couple of small nit observations on comments in the test implementation.

internal/k6runner/k6runner_test.go Outdated Show resolved Hide resolved
internal/k6runner/k6runner_test.go Outdated Show resolved Hide resolved
@nadiamoe nadiamoe force-pushed the k6runner-test-logs branch from c75548e to dda07de Compare June 26, 2024 13:36
@nadiamoe nadiamoe requested a review from ka3de June 26, 2024 13:41
@nadiamoe nadiamoe force-pushed the k6runner-test-logs branch from d67a369 to 911c174 Compare June 26, 2024 13:52
@nadiamoe nadiamoe merged commit 090ba2f into main Jun 26, 2024
4 checks passed
@nadiamoe nadiamoe deleted the k6runner-test-logs branch June 26, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants