GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - apex-dev-tools/benchmarker: Framework for benchmark tests on Salesforce Apex code

BranchesTags
Open more actions menu

Latest commit

 

History

419 Commits
419 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
.vscode
.vscode
 
 
db
db
 
 
docs
docs
 
 
scripts
scripts
 
 
src
src
 
 
test
test
 
 
test_system
test_system
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.mocharc.yml
.mocharc.yml
 
 
.npmrc
.npmrc
 
 
.prettierrc
.prettierrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
compose.yml
compose.yml
 
 
eslint.config.js
eslint.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Benchmarker

A performance testing framework, which orchestrates, profiles, and persists stats from test scenarios run on Salesforce orgs.

Usage

Tests are executed using different templates in a JavaScript testing framework (For example, Mocha, Jest). Results are saved to a provided PostgreSQL database. Alerts for performance degradations can be stored in the database as well. See the alerts documentation for more details.

The TransactionTestTemplate calls a function (FlowStep, most often created by helpers) to execute some anonymous Apex code provided for the test. The Apex can come from a file or inline as a string. This Apex code can also collect Governor limit metrics which will be extracted at the end of the test. After all tests are complete, data attributed to the template can be saved. For a sample execution, see test_system/basic.test.ts.

Development

Building

Available scripts:

  • npm run build - Clean rebuild ready to pack or run.
  • npm run compile - Run typescript compile only.
  • npm test - Run unit tests.
  • npm run test:only -- - Run tests with args passed to mocha.
    • e.g. npm run test:only -- 'path/to/test.ts' -f 'specific test case'
    • Pass path/glob to run specific files, use -f to match cases.

Testing

Running system tests requires a Salesforce Org and Docker. The instructions below assume you have installed Docker, Salesforce CLI, and have a Dev Hub set up. To use another type of org, multiple environment variables need setting with credentials, see .env.example and test_system/.env.

  1. Create a scratch org:

    sf org create scratch -f test_system/config/scratch-org.json -a bench_testing
  2. Start the docker database with docker compose up -d. It is accessible by the host on port 5433, and via adminer control panel at localhost:8081 to review results.

  3. (Run once) Init system test env file with npm run test:system:init. Uncomment SFDX_USERNAME= and update to SFDX_USERNAME=bench_testing. Optionally set any other variables for all tests to use, like STORE_ALERTS.

  4. Finally, run tests:

    npm run test:system

License

All the source code included uses a 3-clause BSD license, see LICENSE for details.

About

Framework for benchmark tests on Salesforce Apex code

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

5 stars

Watchers

3 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.