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

Using "htmlReport" Outside of k6 Script via Command Line #66

Open
QAJin opened this issue Jun 25, 2024 · 0 comments
Open

Using "htmlReport" Outside of k6 Script via Command Line #66

QAJin opened this issue Jun 25, 2024 · 0 comments

Comments

@QAJin
Copy link

QAJin commented Jun 25, 2024

Dear k6-reporter Community,

I'm currently using the htmlReport function from the k6-reporter package to generate HTML reports from k6 test results, and I'm facing a specific challenge that I hope someone in the community might be able to help with.

My current workflow involves two separate processes:

  1. Executing a k6 script and generating a JSON result file k6 run --no-summary --no-thresholds -o json=.\result.json .\test.js.
  2. After the first process is complete, generating an HTML report from the JSON result file.

I'm looking for a way to use the htmlReport function outside of a k6 script, specifically via the command line using Node.js. This separation is crucial for my use case as it allows for better process management and resource allocation.

Currently, I understand that the htmlReport function is typically used within the handleSummary callback in a k6 script. However, I need to call this function directly from a Node.js script after the k6 test execution is finished.

Has anyone in the community found a way to achieve this? Or does anyone have suggestions on how to adapt the htmlReport function for this purpose?

Any guidance, code snippets, or alternative approaches would be greatly appreciated. If you've tackled a similar challenge or have ideas on how to proceed, I'd be very grateful to hear about your experiences or solutions.

Thank you all in advance for your time and assistance 🙏

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

No branches or pull requests

1 participant