JavaScript performance tests for Handsontable
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
$ npm installTest results are stored in MongoDB instance so it is necessary to set up the DB before you run the script. If you have docker installed you can run services using docker-compose.
docker-compose -f docker/docker-compose.yml upTo run performance tests and save the results to the DB execute
$ ./bin/hot-perf runor
$ npm run startPerformance tests are defined in the test/spec directory. Each test contains code which prepares Handsontable for tests
and block of code which then executes several times (defined as SAMPLE_SIZE in the lib/config.js file). After each
call, stats are collected and after the amount of iteration hit the SAMPLE_SIZE the result is saved to the database.
Once completed you can view generated test reports by running ./bin/hot-perf local-server benchmark-viewer.
It serves a page where you can compare your generated results between different Handsontable versions and different test cases.
It runs a benchmark by running all spec files defined in the test/spec directory. Once completed results are saved to the database.
Runs a local server where you can see the test results.
Arguments:
test-runner(ortr) - It serves a test runner page which is used by protractor to test the Handsontable.benchmark-viewer(orbv) - It serves a page which is used to view results generated by theruncommand.
--hot-version- Selects version of the Handsontable to test (it has to be a version which is accessible through jsdelivr). If not specified thelatesttag is used. For example--hot-version=6.2.2.--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 fromdistdirectory, such ashttp://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.