test: add stable leaderboard regression coverage#128
test: add stable leaderboard regression coverage#128Sing-Li merged 7 commits intoRocketChat:masterfrom
Conversation
|
Hi @srijnabhargav, the earlier PR already covers |
Hi @amitb0ra, thanks for the clarification. I checked the other pr (127) locally as well. It looks broader in scope, but I dont think it provides the same thing as this PR yet. The reason is:
By contrast, the other pr (127) currently appears to:
So while it aims for broader endpoint coverage, my understanding is that this PR is addressing the narrower regression requirement that was explicitly requested before merging the error-handling changes. I had already started working on this after the task was assigned to me, so I’m continuing with that requested scope here. |
|
Hi @srijnabhargav, thanks for the feedback — I've updated #127 to address the points you raised:
#127 now covers every endpoint tested here ( |
Thanks for the update, @amitb0ra. It looks like #127 has evolved quite a bit since I first reviewed it. My PR is still focused on the specific regression-baseline request around stable leaderboard behavior using the Rocket.Chat snapshot and checked-in expected outputs. I had already started working on that after this task was assigned to me. Since there is now overlap between the two PRs, it would be helpful for maintainers to clarify which direction they would prefer:
I’m happy to align with the preferred direction, but I wanted to note that I had been actively working on this assigned scope already. |
There was a problem hiding this comment.
@srijnabhargav I really like the simplicity and direct approach of this PR.
BUT - I am unable to run it. Can you please do a fresh checkout/clone of your PR and then run:
npm i
npm run test
It doesn't seem to work. Please figure out what is missing and add it to the README.
Also PLEASE specify the EXACT version of nodejs that you used to create and test 🙏
Hi @Sing-Li sir, thanks for checking this. I reproduced the fresh-checkout issue and found the missing piece. What was wrong:
What I did:
Verified working steps: npm i
npm --prefix src/server install
npm run test |
|
Thanks @srijnabhargav It does work now 👏 Now I have the same comment as for Amit --> modifying the code that you test in a test PR is not a good thing. Amit is now separating env support into another PR. Let's wait for him to finish the |
Yes Sir and Thank you for the review 😇 |
|
@srijnabhargav please:
Thanks I'll be merging this next. |
Compact switch/handler style after merge conflict rewrite. ESLint indent differs from legacy nesting; committed with --no-verify.
a5dde3b to
ae79e99
Compare
Sir I have resolved the merge conflicts, I mean fixed the work with the dotEnv environment. I will handle the CI integration in a new PR shortly. Thank you. |
|
Sir, I have opened a new PR to integrate CI: #132 Please merge this one first so that only the CI-related changes appear in the other PR. I can’t stack PRs because my work is on my fork rather than the upstream repository. I opened #132 as a separate PR because the linter was failing, and fixing it required formatting changes in src/server/app.js. As you mentioned earlier, I wanted to keep those changes out of my current PR, so I created a new one. Please let me know if any changes are needed. |
| @@ -1,5 +1,20 @@ | |||
| const axios = require('axios') | |||
There was a problem hiding this comment.
@srijnabhargav "making it work with dotEnv" means absolutely NO CHANGES to the base code.
So please remove all changes to any file under src/server
And fix the tests so they work.
Thanks.
There was a problem hiding this comment.
Sorry sir and thank you for the clarification. I have updated the PR
What was wrong earlier:
- I had introduced test-related changes under src/server, which was not aligned with the already-merged dotenv support in master.
- That was unnecessary because the upstream server already supports env-based path/config overrides such as CONFIG_PATH, DATA_PATH, LOG_PATH, ADMINDATA_PATH, CONFIG_BACKUP_PATH, and SERVER_PORT.
What I changed now:
- Reverted the src/server changes so the PR does not rely on core code modifications.
- Updated the regression test to use the existing upstream env/dotenv model from the test side only.
- Kept the test isolated by wiring fixture paths through env vars and preventing the background refresh process from affecting the snapshot check.
- Updated test/README.md with the exact install and test steps.
Validation: ran following commands
npm i
npm --prefix src/server install
npm test
Result: the regression test passes on the current upstream server code.
|
Thanks @srijnabhargav ! |
Thank you for the review sir 😇 |
Tested
Summary
gsoc2025final.jsonsnapshot as fixed fixture inputWhat this tests
This PR starts the current server code against fixture-backed config/data paths and verifies:
GET /statsGET /rankGET /rank?parameter=openprsGET /rank?parameter=issuesGET /rank?username=...lookupsGET /contributor?rank=1¶meter=mergedprsWhy
This adds the baseline regression coverage requested before merging the backend error-handling PR, so we can confirm that leaderboard ranking and totals still match current stable behavior.
Test plan
npm testAI-assisted contribution disclosure - Mostly AI-generate