Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions packages/bson-bench/src/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class Task {
benchmark: Omit<BenchmarkSpecification, 'installLocation'> & { installLocation: string };
taskName: string;
testName: string;
tags?: string[];
/** @internal */
children: ChildProcess[];
/** @internal */
Expand All @@ -33,6 +34,7 @@ export class Task {
this.result = undefined;
this.children = [];
this.hasRun = false;
this.tags = benchmarkSpec.tags;
this.benchmark = { ...benchmarkSpec, installLocation: Task.packageInstallLocation };

this.taskName = `${path.basename(this.benchmark.documentPath, 'json')}_${
Expand Down Expand Up @@ -119,6 +121,7 @@ export class Task {
const perfSendResults: PerfSendResult = {
info: {
test_name: this.testName,
tags: this.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
7 changes: 6 additions & 1 deletion 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