Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/bson-bench/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export type BenchmarkSpecification = {
* local package */
library: string;
installLocation?: string;
tags?: string[];
};

export interface RunBenchmarkMessage {
Expand Down
1 change: 1 addition & 0 deletions packages/bson-bench/src/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class Task {
const perfSendResults: PerfSendResult = {
info: {
test_name: this.testName,
tags: this.benchmark.tags,
args: {
warmup: this.benchmark.warmup,
iterations: this.benchmark.iterations,
Expand Down
3 changes: 2 additions & 1 deletion packages/bson-bench/test/unit/suite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ describe('Suite', function () {
warmup: 10,
iterations: 10,
library: '[email protected]',
options: {}
options: {},
tags: ['test']
};
suite
.task({
Expand Down
14 changes: 12 additions & 2 deletions packages/bson-bench/test/unit/task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('Task', function () {
operation,
warmup: 100,
iterations: 100,
options: {}
options: {},
tags: ['test']
}
];
})
Expand Down Expand Up @@ -77,6 +78,10 @@ describe('Task', function () {
expect(task.testName).to.not.include(test.library);
expect(task.testName).to.match(/bson|bson-ext/);
});

it('collects the tags correctly', function () {
expect(task.tags).to.deep.equal(['test']);
});
});
}

Expand Down Expand Up @@ -210,7 +215,8 @@ describe('Task', function () {
operation: 'deserialize',
warmup: 1,
iterations: 1,
options
options,
tags: ['test', 'test2']
});

task.result = {
Expand All @@ -226,6 +232,10 @@ describe('Task', function () {
expect(results.info).to.haveOwnProperty('args');
});

it('returns the tags in the info.tags field', function () {
expect(results.info.tags).to.deep.equal(['test', 'test2']);
});

it('returns options provided in constructor in the info.args field', function () {
expect(results.info.args).to.haveOwnProperty('warmup');
expect(results.info.args).to.haveOwnProperty('iterations');
Expand Down
Loading