Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"start": "npm run build && NODE_ENV=development webpack-dev-server --host 0.0.0.0 --open --hot --config build/webpack.config.js",
"build": "npm --prefix admin run build && NODE_ENV=production webpack --config build/webpack.config.js",
"serve": "cd src/server && NODE_ENV=development node app.js",
"lint": "eslint ."
"lint": "eslint .",
"test": "node --test \"test/**/*.test.js\""
},
"husky": {
"hooks": {
Expand Down
26 changes: 26 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Regression tests

This directory holds automated regression tests for stable leaderboard behavior.

`leaderboard-e2e.test.js` starts the current server code against a fixed Rocket.Chat snapshot and verifies that `/stats`, `/rank`, and selected `/contributor` and `/rank?username=` responses still match the checked-in expected output.

Node version used:

- Node.js `v25.4.0`

Fixtures:

- `../contrib/rocketchat/gsoc/2025/gsoc2025final.json` is the canonical snapshot used as the fixed leaderboard input.
- `fixtures/gsoc2025final.expected.json` is the checked-in golden output generated from the current stable ranking logic and used for regression comparisons.

Run from the repo root:

```bash
npm i
npm --prefix src/server install
npm test
```

Note: `npm i` at the repo root installs only root dependencies. The regression test boots `src/server/app.js`, so `src/server` dependencies must also be installed before running `npm test`.

The test itself uses the env/path override support already available in the upstream dotenv-based server setup (`CONFIG_PATH`, `DATA_PATH`, `LOG_PATH`, `ADMINDATA_PATH`, `CONFIG_BACKUP_PATH`, `SERVER_PORT`) and does not require additional source changes under `src/server`.
12 changes: 12 additions & 0 deletions test/fixtures/gsoc2025final.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"organization": "RocketChat",
"organizationHomepage": "https://rocket.chat/",
"organizationGithubUrl": "https://github.com/RocketChat",
"authToken": "",
"adminPassword": "123456",
"delay": "10",
"serverPort": "62050",
"contributors": [],
"startDate": "2024-12-01",
"includedRepositories": []
}
Loading