Skip to content

Commit f8b9aa6

Browse files
committed
Add benchmark env 'label' support.
1 parent 6bc633f commit f8b9aa6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/earl-report.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ const _benchmarkContext = {
126126
'jldb:Environment': {'@type': '@id'},
127127

128128
// per environment
129+
// label
130+
// ex: 'Setup 1' (for reports)
131+
'jldb:label': {'@type': 'xsd:string'},
129132
// architecture type
130133
// ex: x86
131134
'jldb:arch': {'@type': 'xsd:string'},
@@ -171,6 +174,7 @@ EarlReport.prototype.setupForBenchmarks = function(options) {
171174
if(options.testEnv) {
172175
// add report environment
173176
const fields = [
177+
['label', 'jldb:label'],
174178
['arch', 'jldb:arch'],
175179
['cpu', 'jldb:cpu'],
176180
['cpuCount', 'jldb:cpuCount'],

tests/test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* TEST_ENV=cpu,runtime # only cpu and runtime
1919
* TEST_ENV=auto,comment='special test' # all auto with override
2020
* Available fields:
21+
* - label - ex: 'Setup 1' (short label for reports)
2122
* - arch - ex: 'x64'
2223
* - cpu - ex: 'Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz'
2324
* - cpuCount - ex: 8
@@ -114,6 +115,7 @@ if(process.env.TEST_ENV) {
114115
}
115116
_test_env.split(',').forEach(pair => {
116117
if(pair === 'auto') {
118+
testEnv.name = 'auto';
117119
testEnv.arch = 'auto';
118120
testEnv.cpu = 'auto';
119121
testEnv.cpuCount = 'auto';
@@ -131,6 +133,9 @@ if(process.env.TEST_ENV) {
131133
}
132134
}
133135
});
136+
if(testEnv.label === 'auto') {
137+
testEnv.label = '';
138+
}
134139
if(testEnv.arch === 'auto') {
135140
testEnv.arch = process.arch;
136141
}

0 commit comments

Comments
 (0)