Skip to content

ci: add scripts for running full test suite with rate limiting#137

Merged
jakebromberg merged 1 commit intomainfrom
ci/test-scripts
Jan 31, 2026
Merged

ci: add scripts for running full test suite with rate limiting#137
jakebromberg merged 1 commit intomainfrom
ci/test-scripts

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Jan 22, 2026

Summary

Adds dedicated scripts for running CI tests with optional rate limiting support.

Why

The test suite has two categories of tests that are conditionally skipped:

  1. Rate limiting tests - These require specific timing windows and request limits to be configured. Running them with default settings would either cause false failures (limits too low) or make the tests meaningless (limits too high). They're skipped by default with TEST_RATE_LIMITING=false.

  2. Admin ban tests - These require authenticated admin credentials (AUTH_USERNAME/AUTH_PASSWORD) to test the ban functionality. Since CI doesn't have these credentials configured by default, these tests are skipped.

Previously, there was no easy way to run the full test suite with these features enabled. Developers had to manually set environment variables and hope they matched what docker-compose expected.

What

  • ci-env.sh - Sets up the CI Docker environment. The --full flag exports TEST_RATE_LIMITING=true and optionally enables the default admin user if credentials are configured.

  • ci-test.sh - Runs the test suite with proper environment variables. The --full flag enables rate limiting tests and passes the rate limit configuration to Jest so test assertions match the actual limits.

  • docker-compose.yml - Adds rate limiting environment variables with CI-appropriate defaults (short windows, low limits for fast test execution).

Usage

# Standard test run (rate limiting tests skipped)
npm run ci:testmock

# Full test run with rate limiting enabled
npm run ci:testmock:full

Test plan

  • npm run ci:testmock runs standard tests without rate limiting
  • npm run ci:testmock:full runs full suite with rate limiting tests

@jakebromberg jakebromberg force-pushed the ci/test-scripts branch 2 times, most recently from d275590 to 07d17d5 Compare January 31, 2026 12:48
- Add scripts/ci-env.sh to start CI environment with --full flag
- Add scripts/ci-test.sh to run tests with rate limiting enabled
- Update package.json to use shell scripts for CI commands
- Increase rate limits in docker-compose.yml to avoid test conflicts
- Admin ban tests disabled until credentials configured (see #133)

The full test suite can now be run with:
  npm run ci:env:full && npm run ci:test:full && npm run ci:clean
@jakebromberg jakebromberg merged commit d62ecdd into main Jan 31, 2026
4 checks passed
@jakebromberg jakebromberg deleted the ci/test-scripts branch January 31, 2026 20:33
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.

1 participant