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

Query: Please clarify how to configure various reports in this template ? #27

Open
PavanMudigondaTR opened this issue Aug 10, 2022 · 2 comments

Comments

@PavanMudigondaTR
Copy link

Could you please clarify how to configure various reports in this template ? Can I set them to template level rather than at each test case level.

@tom-miseur
Copy link

Hi @PavanMudigondaTR.

I'm not sure I understand the question and how it relates specifically to k6-template-typescript. What do you mean by a "template-level" report?

If you're wondering what the code for handleSummary might look like in TypeScript, you can use something like this as mentioned in this blog post:

/* Customizes the end-of-test summary report */
export function handleSummary(data: JSONObject): JSONObject {
	const ret: JSONObject = {
		stdout: textSummary(data, { indent: ' ', enableColors: true }),
	}
	if (!!__ENV.RESULTS_PATH) {
		const jUnitResultFile = `${__ENV.RESULTS_PATH}/results.xml`
		const logResultFile = `${__ENV.RESULTS_PATH}/results.log`
		ret[jUnitResultFile] = jUnit(data)
		ret[logResultFile] = textSummary(data, { indent: ' ', enableColors: false })
	}
	return ret
}

@PavanMudigondaTR
Copy link
Author

@tom-miseur I was trying to understand how test results get reported when I have say 100 test cases. Is it possible to run all tests at once and get one report of each type (xml, log, html report).

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

2 participants