feat: enhance HTML report generation by including environment name (#6055)

This commit is contained in:
Sanjai Kumar
2025-11-18 16:09:57 +05:30
committed by GitHub
parent 2ac41806a2
commit 50442d960d
3 changed files with 79 additions and 5 deletions

View File

@@ -656,6 +656,9 @@ const handler = async function (argv) {
const totalTime = results.reduce((acc, res) => acc + res.response.responseTime, 0);
console.log(chalk.dim(chalk.grey(`Ran all requests - ${totalTime} ms`)));
// Extract environment name from envVars if available
const environmentName = envVars?.__name__ || null;
const formatKeys = Object.keys(formats);
if (formatKeys && formatKeys.length > 0) {
const outputJson = {
@@ -666,7 +669,7 @@ const handler = async function (argv) {
const reporters = {
'json': (path) => fs.writeFileSync(path, JSON.stringify(outputJson, null, 2)),
'junit': (path) => makeJUnitOutput(results, path),
'html': (path) => makeHtmlOutput(outputJson, path, runCompletionTime),
html: (path) => makeHtmlOutput(outputJson, path, runCompletionTime, environmentName)
}
for (const formatter of Object.keys(formats))