test: strengthen performance, security, and snapshot regression coverage - #1196
Merged
Xoulomon merged 1 commit intoSep 1, 2026
Merged
Conversation
Issue Xoulomon#1134: Add waste-submission regression performance test - New k6 scenario (scenarios/waste-submission-regression.js) covering the core waste-submission flow: register -> submit -> verify -> query incentives - Configurable BASE_URL, ramping VUs (0->20->50->0), and detailed thresholds - p50/p95/p99 latency and error rate thresholds with 20% regression policy - Baselines added to baselines.json with staging-env-measurement note - Integrated into run-perf-tests.sh test suite - Updated performance/README.md with documentation and usage Issue Xoulomon#1135: Add OWASP-relevant security test suite - idor.test.ts: 11 tests covering broken object-level authorization (waste, participant, incentive ownership, enumeration resistance) - broken-authentication.test.ts: 12 tests covering missing auth, invalid/ expired tokens, wallet-based auth bypass, spoofed headers - injection-input-validation.test.ts: 25+ tests covering SQL/ORM injection, XSS, command injection, malformed JSON, path traversal, header injection - Updated security-tests/README.md with OWASP coverage map, contributor guide, and environment requirements Issue Xoulomon#1136: Document snapshot review process - frontend/e2e/__snapshots__/SNAPSHOT_REVIEW.md: Complete review process guide with contributor and reviewer checklists - Updated frontend/VISUAL_REGRESSION.md with review checklist and when to update/reject snapshot changes
|
@Yebom3220 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive performance regression testing, modernized security tests, and a snapshot review process for the Scavenger platform. It addresses three testing infrastructure issues to improve quality assurance and prevent regressions.
Issue #1134 — Performance Regression Testing
Scenario added:
performance/scenarios/waste-submission-regression.jsA dedicated k6 regression test exercising the core waste-submission flow:
Configuration:
BASE_URL(default:http://localhost:3000/api)Regression Thresholds:
Baseline methodology: Initial estimates in
baselines.jsonunderwaste_submission_regressionwith a note that actual values require staging environment measurement. No fabricated numbers.Integration: Added to
run-perf-tests.shalongside existing load/stress/endurance/spike tests.Documentation: Updated
performance/README.mdwith usage instructions, threshold table, and regression policy.Issue #1135 — Security Test Suite
New test files:
tests/idor.test.ts(11 tests)tests/broken-authentication.test.ts(12 tests)tests/injection-input-validation.test.ts(25+ tests)OWASP Top 10 coverage: A01 (Access Control), A02 (Crypto), A03 (Injection), A05 (Misconfig), A06 (Components), A07 (Auth), A08 (Data Integrity).
Documentation: Updated
security-tests/README.mdwith OWASP coverage map, contributor guide, test naming conventions, assertion best practices, and environment requirements.Secrets check: All test fixtures use deterministic fake/test credentials. No real API keys, private keys, or credentials.
Issue #1136 — Snapshot Review Process
New file:
frontend/e2e/__snapshots__/SNAPSHOT_REVIEW.mdUpdated:
frontend/VISUAL_REGRESSION.mdSnapshot audit: The existing
__snapshots__/directories contain only.gitkeepfiles (no committed baselines). The visual-regression.spec.ts tests (32 tests across 3 browser projects) are properly configured and documented.Validation
Syntax & Compilation
esbuildcompilation: All 3 new security test files — PASSnode --check: Performance scenario — PASSbash -n: Shell script — PASSJSON.parse: baselines.json — PASSSecurity Tests
npx vitest run— Tests compile and execute. Failures are expected (no backend running) and indicate connection-refused errors, not code issues.Existing Tests
Files Changed (10 total)
Modified (5):
performance/baselines.json— Added waste_submission_regression baselinesperformance/run-perf-tests.sh— Added regression test to suiteperformance/README.md— Added regression test documentationsecurity-tests/README.md— Added OWASP coverage, contributor guidefrontend/VISUAL_REGRESSION.md— Added review checklistNew (5):
performance/scenarios/waste-submission-regression.js— k6 regression testsecurity-tests/tests/idor.test.ts— IDOR testssecurity-tests/tests/broken-authentication.test.ts— Auth testssecurity-tests/tests/injection-input-validation.test.ts— Injection testsfrontend/e2e/__snapshots__/SNAPSHOT_REVIEW.md— Review process docsReview Checklist
Issues Closed
Closes #1134
Closes #1135
Closes #1136