Skip to content

Commit 245ffa5

Browse files
committed
test: add stress test scripts for large file handling
- stress-test.js: Tests ValueExtractor performance with 10K/50K/100K/500K/1M lines - generate-test-file.js: Generates test log files for browser testing - Add npm run test:stress script - Update CI to run stress tests on every PR Test results: - 10K lines: 13ms parse time, 14MB memory - 50K lines: 50ms parse time, 30MB memory - 100K lines: 110ms parse time, 66MB memory - 500K lines: 378ms parse time, 284MB memory - 1M lines: 681ms parse time, 606MB memory
1 parent 6452343 commit 245ffa5

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
pull_request:
55
push:
6-
branches: [ main ]
6+
branches: [ main, master ]
77

88
jobs:
99
test:
@@ -15,6 +15,21 @@ jobs:
1515
node-version: '20'
1616
cache: 'npm'
1717
- run: npm install
18+
- run: npm run lint
1819
- run: npm test
1920
env:
2021
CI: true
22+
23+
stress-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
- run: npm install
32+
- name: Run stress test (10K - 1M lines)
33+
run: npm run test:stress
34+
env:
35+
NODE_OPTIONS: '--max-old-space-size=4096'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build": "vite build",
1111
"lint": "eslint .",
1212
"preview": "vite preview",
13-
"test": "vitest run --coverage"
13+
"test": "vitest run --coverage",
14+
"test:stress": "node scripts/stress-test.js"
1415
},
1516
"dependencies": {
1617
"@tailwindcss/forms": "^0.5.10",

scripts/stress-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ async function runStressTest() {
9393
{ lines: 10000, name: '10K lines' },
9494
{ lines: 50000, name: '50K lines' },
9595
{ lines: 100000, name: '100K lines' },
96+
{ lines: 500000, name: '500K lines' },
97+
{ lines: 1000000, name: '1M lines' },
9698
];
9799

98100
testMemoryUsage('Initial');
@@ -143,4 +145,11 @@ async function runStressTest() {
143145
}
144146

145147
// Run the test
146-
runStressTest().catch(console.error);
148+
runStressTest()
149+
.then(() => {
150+
process.exit(0);
151+
})
152+
.catch((error) => {
153+
console.error('❌ Stress test failed:', error);
154+
process.exit(1);
155+
});

0 commit comments

Comments
 (0)