refactor: Rename runtime to runDuration (#6323)

* refactor: Rename 'runtime' to 'runDuration'

* revert changes made in report.html
This commit is contained in:
Sanjai Kumar
2025-12-05 19:17:06 +05:30
committed by GitHub
parent 5302addda0
commit f479e0d325
3 changed files with 11 additions and 11 deletions

View File

@@ -575,7 +575,7 @@ const handler = async function (argv) {
results.push({
...result,
runtime: process.hrtime(start)[0] + process.hrtime(start)[1] / 1e9,
runDuration: process.hrtime(start)[0] + process.hrtime(start)[1] / 1e9,
suitename: pathname.replace('.bru', ''),
name
});

View File

@@ -24,7 +24,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@tests': totalTests,
'@timestamp': new Date().toISOString().split('Z')[0],
'@hostname': os.hostname(),
'@time': result.runtime.toFixed(3),
'@time': result.runDuration.toFixed(3),
'testcase': []
};
@@ -34,7 +34,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@name': `${assertion.lhsExpr} ${assertion.rhsExpr}`,
'@status': assertion.status,
'@classname': result.request.url,
'@time': (result.runtime / totalTests).toFixed(3)
'@time': (result.runDuration / totalTests).toFixed(3)
};
if (assertion.status === 'fail') {
@@ -52,7 +52,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@name': test.description,
'@status': test.status,
'@classname': result.request.url,
'@time': (result.runtime / totalTests).toFixed(3)
'@time': (result.runDuration / totalTests).toFixed(3)
};
if (test.status === 'fail') {
@@ -70,7 +70,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@name': test.description,
'@status': test.status,
'@classname': result.request.url,
'@time': (result.runtime / totalTests).toFixed(3)
'@time': (result.runDuration / totalTests).toFixed(3)
};
if (test.status === 'fail') {
@@ -88,7 +88,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@name': test.description,
'@status': test.status,
'@classname': result.request.url,
'@time': (result.runtime / totalTests).toFixed(3)
'@time': (result.runDuration / totalTests).toFixed(3)
};
if (test.status === 'fail') {
@@ -110,7 +110,7 @@ const makeJUnitOutput = async (results, outputPath) => {
'@name': 'Test suite has no errors',
'@status': 'fail',
'@classname': result.request.url,
'@time': result.runtime.toFixed(3),
'@time': result.runDuration.toFixed(3),
'error': [{ '@type': 'error', '@message': result.error }]
}
];

View File

@@ -40,7 +40,7 @@ describe('makeJUnitOutput', () => {
error: 'expected 200 to not equal 200'
}
],
runtime: 1.2345678
runDuration: 1.2345678
},
{
request: {
@@ -62,7 +62,7 @@ describe('makeJUnitOutput', () => {
status: 'fail'
}
],
runtime: 2.3456789
runDuration: 2.3456789
}
];
@@ -110,7 +110,7 @@ describe('makeJUnitOutput', () => {
status: 'fail'
}
],
runtime: 1.2345678,
runDuration: 1.2345678,
error: 'timeout of 2000ms exceeded'
}
];
@@ -164,7 +164,7 @@ describe('makeJUnitOutput', () => {
error: 'expected 200 to equal 404'
}
],
runtime: 1.2345678
runDuration: 1.2345678
}
];