Skip to content

Commit 9c713c9

Browse files
committed
fix: adjust ci & lint to new benchmarks
1 parent 64729f8 commit 9c713c9

File tree

7 files changed

+20
-170
lines changed

7 files changed

+20
-170
lines changed

.c8rc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"exclude": [
55
"src/**/index.ts",
66
"src/**/*-fuzz.ts",
7+
"src/**/__benchmarks__/*.ts",
78
"src/jsutils/Maybe.ts",
89
"src/jsutils/ObjMap.ts",
910
"src/jsutils/PromiseOrValue.ts",

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
# Ignore TS files inside integration test
1212
/integrationTests/ts/*.ts
13+
14+
# Ignore config files
15+
/vitest.config.ts

.eslintrc.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,12 @@ module.exports = {
637637
],
638638
},
639639
},
640+
{
641+
files: 'src/**/__benchmarks__/**',
642+
rules: {
643+
'import/no-nodejs-modules': 'off',
644+
},
645+
},
640646
{
641647
files: 'integrationTests/*',
642648
env: {

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ jobs:
5858
rm gitignore/Global/Images.gitignore
5959
cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore
6060
61-
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
61+
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
62+
IGNORED_FILES=$(echo "$IGNORED_FILES" | grep -v 'patches/@codspeed+core+3.1.0.patch')
6263
if [[ "$IGNORED_FILES" != "" ]]; then
6364
echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g'
6465
exit 1

resources/benchmark-tinybench.ts

Lines changed: 0 additions & 162 deletions
This file was deleted.

src/__benchmarks__/list.bench.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { bench,describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

33
import { parse } from '../language/parser.js';
44

@@ -17,6 +17,7 @@ function syncListField() {
1717
return results;
1818
}
1919

20+
// eslint-disable-next-line @typescript-eslint/require-await
2021
async function asyncListField() {
2122
const results = [];
2223
for (let index = 0; index < 1000; index++) {
@@ -25,22 +26,23 @@ async function asyncListField() {
2526
return results;
2627
}
2728

29+
// eslint-disable-next-line @typescript-eslint/require-await
2830
async function* asyncIterableListField() {
2931
for (let index = 0; index < 1000; index++) {
3032
yield index;
3133
}
3234
}
3335

34-
describe("execute listField benchmarks", () => {
35-
bench("Execute Synchronous List Field", async () => {
36+
describe('execute listField benchmarks', () => {
37+
bench('Execute Synchronous List Field', async () => {
3638
await execute({ schema, document, rootValue: { listField: syncListField } });
3739
});
3840

39-
bench("Execute Asynchronous List Field", async () => {
41+
bench('Execute Asynchronous List Field', async () => {
4042
await execute({ schema, document, rootValue: { listField: asyncListField } });
4143
});
4244

43-
bench("Execute Async Iterable List Field", async () => {
45+
bench('Execute Async Iterable List Field', async () => {
4446
await execute({ schema, document, rootValue: { listField: asyncIterableListField } });
4547
});
4648
});

src/__benchmarks__/visitor.bench.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { bench, describe } from 'vitest';
22

3-
import { visit, visitInParallel } from '../language/visitor.js';
4-
53
import { parse } from '../language/parser.js';
4+
import { visit, visitInParallel } from '../language/visitor.js';
65

76
import { bigSchemaSDL } from './fixtures.js';
87

0 commit comments

Comments
 (0)