Skip to content

k6 Load Testing Tool Integration#129

Closed
josecmu27 wants to merge 60 commits into
mainfrom
tool/k6-load-testing
Closed

k6 Load Testing Tool Integration#129
josecmu27 wants to merge 60 commits into
mainfrom
tool/k6-load-testing

Conversation

@josecmu27

Copy link
Copy Markdown

k6 Load Testing Tool Integration

Summary

This PR integrates k6 as a dynamic analysis tool for load testing the NodeBB application. k6 simulates multiple concurrent users hitting key endpoints to measure performance and identify bottlenecks under stress.


Evidence of Installation

  • Created k6/README.md with installation instructions (brew install k6)
  • Created k6/load-test.js test script
  • Created k6/output.txt containing terminal output from a full test run

Test Results

The test ramped up from 10 to 50 virtual users across ~3.5 minutes, hitting 4 key endpoints:

  • / (Homepage)
  • /categories
  • /recent
  • /api/categories
checks_total.......: 11952   45.684351/s
checks_succeeded...: 99.98%  11950 out of 11952
checks_failed......: 0.01%   2 out of 11952

✓ homepage status is 200
✗ homepage loads in <2s
  ↳  99% — ✓ 1327 / ✗ 1
✓ categories status is 200
✓ categories loads in <2s
✓ recent topics status is 200
✗ recent topics loads in <2s
  ↳  99% — ✓ 1327 / ✗ 1
✓ API status is 200
✓ API responds in <1s
✓ API returns JSON

Overall success rate of 99.98% across ~12,000 checks. The 2 failures were occasional response time spikes on the homepage and recent topics page under peak load (50 concurrent users), which is a meaningful finding about the system's performance ceiling.


Pros

  • Easy to set up — standalone binary with minimal configuration needed
  • Readable scripting — test scripts are written in plain JavaScript, making them easy to write and maintain
  • Detailed metrics — provides response times, error rates, percentiles (p95), and custom thresholds out of the box
  • Realistic load simulation — supports staged ramp-up/ramp-down to mimic real traffic patterns
  • Clear pass/fail thresholds — can be configured to fail CI pipelines if performance degrades
  • No interference with existing mocha/ESLint tooling

Cons

  • Not an npm package — requires a separate binary installation, which complicates CI/CD integration compared to npm-based tools
  • No browser simulation — tests HTTP endpoints only; doesn't simulate real browser behavior (JS rendering, assets, etc.)
  • Requires a live server — cannot be run without a running NodeBB instance, making it harder to integrate into standard unit test pipelines
  • Limited to black-box testing — only observes external behavior, gives no insight into internal code paths or memory usage
  • Threshold tuning required — default thresholds need manual calibration per project to be meaningful

connorcarpenter15 and others added 30 commits February 2, 2026 17:51
Store the forwarded message ID when adding new messages to the database.
Update the API endpoints in `src/messaging/data.js` to properly add
forwarded messages to message objects when returning data to the
frontend.

Also, update OpenAPI schemas to reflect forwarded message additions.
…riting part into the db, and reading forwarded message from db is also available. Partially modified the front-end.
Added pop up that displays the chats you can forward the current message to, when the user is hovering over a message.
feat(backend): add forwarded messages
Add the forward button based on the updates from Varidhi.
Update the message view to incorporate a forwarded message view if the
forwarded message attribute is populated.
Fix the scope of the forwardMid test to properly call the API.
Add forward messaging feature. Users can now forward an message in the chats from one room to another by clicking a button next to reply.
Fix lint and error  message attempt 2
Allow registered users to save custom color theme preferences via the
existing settings API (`PUT /api/v3/users/:uid/settings`). Seven new
fields are stored in the user:{uid}:settings hash:

  - `customThemeColor_headerBg` / `customThemeColor_headerText`
  - `customThemeColor_bodyBg` / `customThemeColor_bodyText`
  - `customThemeColor_linkColor`
  - `customThemeColor_buttonBg` / `customThemeColor_buttonText`

Values are validated as 6-digit hex colors (`#RRGGBB`) on save and
HTML-escaped via `validator.escape()` on read to prevent XSS. Empty
strings are accepted to clear a color.

No new routes, controllers, or database keys — the implementation
follows the existing bootswatchSkin pattern in `src/user/settings.js`.

Tests: 4 new cases covering valid save, invalid rejection, empty
values, and XSS sanitization.
Added a custom skin option in the settings and added a color picker.
- Add reactions.js with addReaction, removeReaction, toggleReaction, getReactions, and deleteReactions
- Register reactions module in messaging index
Endpoints for message reactions feature. (Issue 2)
- GET /:roomId/messages/:mid/reactions
- POST /:roomId/messages/:mid/reactions
Issue 3:
Include reactions in message payload
Issue 4:
Broadcast full reactions array to room on add/remove
sittingthyme and others added 29 commits February 23, 2026 11:43
Custom Color Theme: Backend Implementation
Update the OpenAPI SettingsObj schema to properly store new custom
colortheme parameters.
Custom Skin Color Picker: Frontend Implementation
- Replace 2-field (customPrimaryColor/customSecondaryColor) frontend
  with the 7-field backend model (customThemeColor_headerBg,
  headerText, bodyBg, bodyText, linkColor, buttonBg, buttonText)
- Add 7 color picker pairs to settings.tpl with reset button
- Rewrite applyCustomColors() to map each field to correct CSS
  targets (body bg/text via root vars, sidebar/brand via selectors)
- Update header.tpl FOUC prevention script to use 7-field model
- Target harmony theme elements (.sidebar-left, .sidebar-right,
  .brand-container) instead of non-existent .navbar
- Update api.js to pass all 7 fields to client config
- Remove unused customPrimaryColor/customSecondaryColor from backend
  settings.js and OpenAPI schemas
- Add translation keys to en-GB/user.json (was only in en-US)
- Fix no-bitwise lint warnings in shadeColor helper
- Fix indentation in render.js
Custom Color Theme: Full-Stack Implementation (#10)
feat(chat): implement frontend reaction system for chat messages

- Add initReactionHandlers to handle reaction button clicks
- Integrate emoji-dialog picker for selecting reactions
- Implement toggleReaction API call to backend
- Add click handler for existing reaction pills (toggle behavior)

feat(chat): handle real-time reaction updates via socket event

- Add socket listener for event:chats.reaction
- Implement onReactionUpdate to dynamically re-render reaction pills
- Preserve reaction add button while refreshing reaction list
- Re-parse emojis using app.parseAndTranslate
- Render reaction pills with emoji and count
- Highlight reactions made by current user
- Add reaction-add button for emoji picker integration
- Add chat-reactions layout and pill design
- Style emoji and count display
- Add active state for user reactions
- Add hover interactions for pills and add button
- Hide reaction-add button until message hover
feat(chat): implement frontend reactions system
Message-Reactions: Full-Stack Implementation

All CI test cases passed.
Add user documentation covering usage instructions, user testing steps,
and automated test locations for the three sprint features: message
forwarding, message reactions, and custom color scheme.
Add UserGuide.md for sprint features
Update the Docker Compose file to give NodeBB root user privileges for
deploying on the VM.
chore: Grant root privileges to NodeBB Docker service
Add a `vm_deploy.yml` file to set up a GitHub workflow for deploying to
the VM.
@josecmu27 josecmu27 closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants