Skip to content

Commit

Permalink
Merge branch 'release/v2.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
budnix committed Sep 26, 2022
2 parents 4de761b + 645e3a6 commit 084ae22
Show file tree
Hide file tree
Showing 7 changed files with 2,932 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
14
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ JavaScript performance tests for Handsontable

## Install

The minimal Node version which this project can run on is 11. Make sure that your version meets that criteria before
The minimal Node version which this project can run on is 14. Make sure that your version meets that criteria before
you continue with the installation.

Install dependencies via [NPM](https://npmjs.com/)
Expand Down Expand Up @@ -60,6 +60,7 @@ Arguments:
- ```--hot-server``` - Selects a server to be used to serve the Handsontable assets. For example `--hot-server=http://localhost:8082`. If
used the assets are loaded from `dist` directory, such as `http://localhost:8082/dist/handsontable.full.css`.
- ```--test-name``` - The name under which the test will be saved. For example `--test-name=my-feature`. If a test by that name is already stored, it will be replaced with the new test results.
- ```--cpu-throttle-rate``` - The argument sets the CPU throttle rate for the browser. Adjusting the clock speed of the CPU slows down the computer. This can be useful for detecting slight deviations in performance that normally cannot be seen on a fast computer. It's advisable to perform the tests with rate sets as 4, for example, `--cpu-throttle-rate=4`.

## License

Expand Down
1 change: 1 addition & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function parseArgs() {
.option('--hot-version <version>', 'The Handsontable <version> which will be used for running a benchmark.', hotVersionRegExp)
.option('--hot-server <url>', 'The server <url> which will be used to serve Handsontable assets from.')
.option('--test-name <name>', 'The <name> name under which the test will be saved.')
.option('--cpu-throttle-rate <number>', 'The <number> CPU throttle rate.')
.action(async (args, options) => {
await require('./commands/local-server')('test-runner', config.SERVER_PORT, options);

Expand Down
3 changes: 2 additions & 1 deletion lib/commands/protractor/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const { fork } = require('child_process');

module.exports = function ({ hotVersion = 'latest', hotServer, testName } = {}) {
module.exports = function ({ hotVersion = 'latest', cpuThrottleRate = 0, hotServer, testName } = {}) {
console.log('Running protractor...');

const env = process.env;

env.HOT_VERSION = testName ? testName : (hotServer ? 'develop' : hotVersion);
env.CPU_THROTTLE_RATE = cpuThrottleRate;

const childProcess = fork('./node_modules/.bin/protractor', ['protractor.conf.js'], { env });

Expand Down
Loading

0 comments on commit 084ae22

Please sign in to comment.