
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
Cymetrics is a Cypress post process that looks at durations on an individual test case level and at a file level, to determine the fastest completion time for the amount of test runners available. The average duration of multiple runs will be used, so the
Cymetrics is a Cypress post process that looks at durations on an individual test case level and at a file level, to determine the fastest completion time for the amount of test runners available. The average duration of multiple runs will be used, so the more cymetrics is used, the more accurate it becomes.
Check out the scenario section for a better understanding of cymetrics, or the sample project, cypress-playground demonstrating cymetrics' use.
The Cypress test suite contains 4 files and each file contains 2 test cases. We normally run this suite nightly on a single Jenkins runner. We recently got a second Jenkins test runner and would like to as evenly as possible distribute the tests between our 2 test runners in order to get the shortest overall test duration.
After one run of the entire test suite we get the following information:
Total Runtime WITHOUT cymetrics: 36 minutes
Cymetrics will now take this information and find the shortest overall duration possible given 2 test runners.
Scenario output at the test case level: (Total Runtime WITH cymetrics: 18 minutes)
Real output would look something like this:
{
"g1": {
"files": [
"tc_3.2",
"tc_4.1",
"tc_1.1"
],
"estTotalDuration": 1080000
},
"g2": {
"files": [
"tc_1.2",
"tc_4.2",
"tc_3.1",
"tc_2.1",
"tc_2.2"
],
"estTotalDuration": 1080000
}
}
Scenario output at the file level: (Total Runtime WITH cymetrics: 19 minutes)
Real output would look something like this:
{
"g1": {
"title": [
"cypress/integration/file_3.js",
"cypress/integration/file_2.js"
],
"estTotalDuration": 1080000,
"command": "npm run spec 'cypress/integration/file_3.js','cypress/integration/file_2.js',"
},
"g2": {
"title": [
"cypress/integration/file_1.js",
"cypress/integration/file_4.js"
],
"estTotalDuration": 1080000,
"command": "npm run spec 'cypress/integration/file_1.js','cypress/integration/file_4.js',"
}
}
Cymetrics requires Mochawesome reporting as input to produce the final metrics.
In order to use mochawesome correctly, we will add async and
child_process to the /plugins/index.js file.
These are optional and feel free to stray from these packages.
The following installations assumes you have met the requirements within the requirements section.
npm install async --save-devnpm install mocha --save-devnpm install cypress-multi-reporters --save-devnpm install mochawesome --save-devnpm install mochawesome-merge --save-devnpm install mochawesome-report-generator --save-devSet the mochawesome reporter settings within the cypress.json file
{
"reporter": "mochawesome",
"reporterOptions": {
"reportDir": "cypress/reports/testCaseResults",
"overwrite": false,
"html": false,
"json": true
}
}
Add these lines to the package.json in the script section.
{
"scripts": {
"clean-reports": "npx rimraf cypress/reports/\"**\"",
"posttest": "npm run mocha-merge && npm run mocha-marge",
"mocha-merge": "npx mochawesome-merge 'cypress/reports/testCaseResults/*json' > cypress/reports/mochawesomeMerged.json",
"mocha-marge": "npx marge cypress/reports/mochawesomeMerged.json -f report -o cypress/reports/html"
}
}
Within the plugins/index.js call the mochawesome scripts
on('before:run', (config) => {
series([() => exec('npm run clean-reports')]);
})
on('after:run', async (config) => {
series([() => exec('npm run posttest')]);
})
npm install cymetrics
Set the mochawesome reporter settings within the cypress.json file
{
"load_balancer": {
"outputDirectory": "output",
"testCaseOutputFileName": "tcDataOutput",
"fileOutputFileName": "fileDataOutput",
"balancedFilesOutputFileName": "balancedFiles",
"balancedTcOutputFileName": "balancedTestCases",
"testRunnerCount": "2",
"mochawesomeReport": "cypress/reports/mochawesomeMerged.json"
}
}
Within the plugins/index.js call cymetrics in an after:run block
on('after:run', async (config) => {
await cymetrics.balance(config)
})
Note: the final plugins/index.js file should look like this:
const cymetrics = require('cymetrics')
const series = require('async').series
const {exec} = require('child_process');
module.exports = (on, config) => {
on('before:run', (config) => {
series([() => exec('npm run clean-reports')]);
})
on('after:run', async (config) => {
series([() => exec('npm run posttest')]);
await cymetrics.balance(config)
})
}
outputDirectory - Folder location where cymetrics output will placed
testCaseOutputFileName - File name for unbalanced data on all the test cases
fileOutputFileName - File name for unbalanced data on all files with test cases
balancedFilesOutputFileName - File name for balanced data for all files with test cases
balancedTcOutputFileName - File name for balanced data on all the test cases
testRunnerCount - The amount of 'baskets' to split up test cases and test files
mochawesomeReport - Location of mochawesome file with combined results
FAQs
Cymetrics is a Cypress post process that looks at durations on an individual test case level and at a file level, to determine the fastest completion time for the amount of test runners available. The average duration of multiple runs will be used, so the
We found that cymetrics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.