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

Log errors when executing setup and teardown via REST API #3290

Merged

Conversation

kmtym1998
Copy link
Contributor

What?

This PR adds error logging for setup and teardown functions invoked from REST API.

Why?

Error logging is added to enhance visibility into errors during setup and teardown, aiding debugging.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make ci-like-lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

Closes #2422

This commit adds error logging when executing the setup and teardown
functions in the k6 API. If an error occurs during setup or teardown, it
will now be logged with the corresponding error message. This improves
error reporting and makes it easier to diagnose issues related to setup
and teardown.

Related issue: grafana#2422
@kmtym1998 kmtym1998 changed the title Log errors when executing setup and teardown Log errors when executing setup and teardown via REST API Aug 20, 2023
@olegbespalov olegbespalov self-requested a review August 23, 2023 12:16
@codecov-commenter
Copy link

Codecov Report

Merging #3290 (15e5cb0) into master (420767c) will decrease coverage by 0.13%.
Report is 2 commits behind head on master.
The diff coverage is 50.00%.

❗ Current head 15e5cb0 differs from pull request most recent head 9deb8e8. Consider uploading reports for the commit 9deb8e8 to get more accurate results

@@            Coverage Diff             @@
##           master    #3290      +/-   ##
==========================================
- Coverage   73.21%   73.09%   -0.13%     
==========================================
  Files         258      256       -2     
  Lines       19884    19881       -3     
==========================================
- Hits        14559    14532      -27     
- Misses       4402     4419      +17     
- Partials      923      930       +7     
Flag Coverage Δ
ubuntu 73.09% <50.00%> (-0.06%) ⬇️
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
api/v1/setup_teardown_routes.go 55.55% <0.00%> (-3.27%) ⬇️
loader/loader.go 83.56% <100.00%> (ø)

... and 11 files with indirect coverage changes

@olegbespalov olegbespalov added this to the v0.47.0 milestone Aug 23, 2023
Copy link
Contributor

@olegbespalov olegbespalov left a comment

Choose a reason for hiding this comment

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

@kmtym1998 change looks good to me 👍 Thanks for the contribution!

@olegbespalov olegbespalov merged commit d8ebbd3 into grafana:master Aug 24, 2023
@kmtym1998 kmtym1998 deleted the feat/log-setup-and-teardown-error branch August 27, 2023 03:21
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.

setup() and teardown() errors are not logged when invoked from REST API
4 participants