-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(express): add benchmark express (#2431)
Add performance test for express. Uses a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to grap sources directly from https://github.com/expressjs/express Co-authored-by: Nico Jansen <jansennico@gmail.com>
- Loading branch information
Showing
10 changed files
with
99 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
name: Performance | ||
|
||
on: | ||
schedule: | ||
- cron: '0 12 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
PERF_TEST_GLOB_PATTERN: | ||
description: 'Glob pattern' | ||
required: true | ||
default: '*' | ||
|
||
jobs: | ||
performance_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build packages | ||
run: npm run build | ||
- name: Run performance tests | ||
run: npm run perf | ||
env: | ||
PERF_TEST_GLOB_PATTERN: ${{ github.event.inputs.PERF_TEST_GLOB_PATTERN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "perf/test/express"] | ||
path = perf/test/express | ||
url = git@github.com:expressjs/express.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"localDependencies": { | ||
"@stryker-mutator/core": "../../../packages/core", | ||
"@stryker-mutator/api": "../../../packages/api", | ||
"@stryker-mutator/javascript-mutator": "../../../packages/javascript-mutator", | ||
"@stryker-mutator/mocha-framework": "../../../packages/mocha-framework", | ||
"@stryker-mutator/mocha-runner": "../../../packages/mocha-runner", | ||
"@stryker-mutator/util": "../../../packages/util" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "../../../packages/core/schema/stryker-schema.json", | ||
"testRunner": "mocha", | ||
"testFramework": "mocha", | ||
"coverageAnalysis": "perTest", | ||
"mutator": "javascript" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { promises as fs } from 'fs'; | ||
import path = require("path"); | ||
|
||
const testRootDir = path.resolve(__dirname, '..', 'test'); | ||
const configRootDir = path.resolve(__dirname, '..', 'config'); | ||
|
||
mergeConfiguration().catch(error => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); | ||
|
||
async function mergeConfiguration() { | ||
const testDirs = (await fs.readdir(testRootDir, { withFileTypes: true })).filter(testDir => testDir.isDirectory()); | ||
for await (const testDir of testDirs) { | ||
const configOverrideDir = path.resolve(configRootDir, testDir.name); | ||
try { | ||
const configDir = await fs.stat(configOverrideDir); | ||
if (configDir.isDirectory()) { | ||
const overridePackageFileName = path.resolve(configOverrideDir, 'package.json'); | ||
const overrideStrykerConfigFileName = path.resolve(configOverrideDir, 'stryker.conf.json'); | ||
try { | ||
const overrides = require(overridePackageFileName); | ||
const original = require(path.resolve(testRootDir, testDir.name, 'package.json')); | ||
await fs.writeFile(path.resolve(testRootDir, testDir.name, 'package.json'), JSON.stringify({ ...original, ...overrides }, null, 2)) | ||
} catch { | ||
console.log(`Note: no overrides found at ${overridePackageFileName}`); | ||
} | ||
try { | ||
await fs.copyFile(overrideStrykerConfigFileName, path.resolve(testRootDir, testDir.name, 'stryker.conf.json')); | ||
} catch { | ||
console.log(`Note: no stryker.conf.json file ${overrideStrykerConfigFileName}`); | ||
} | ||
} | ||
console.log(`✅ Merged config for ${testDir.name}`) | ||
} catch { | ||
console.log(`Note: no config override directory found at ${configOverrideDir}`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters