make_post_sell/test.ini
russell@unturf.com af4b70a160 Fix parallel test execution with isolated per-worker databases
The previous parallel test attempt failed because all workers were trying
to use the same SQLite database file, causing locking errors.

Solution:
- Created conftest.py to configure pytest-xdist workers
- Each worker gets a unique database file (test_make_post_sell_gw0.sqlite, etc.)
- Enabled SQLite WAL (Write-Ahead Logging) mode for better concurrency
- WAL allows multiple readers while a writer is active
- Modified test.ini to use $TEST_DATABASE_PATH environment variable
- Automatic cleanup of worker databases after test completion

Benefits:
- True isolation between test workers
- No database locking conflicts
- Tests can run fully in parallel
- Expected test time reduction from 30min to ~5-10min

Each worker's database is completely isolated, preventing the SQLite
"database is locked" errors that plagued the previous attempt.
2026-01-21 12:07:16 -05:00

97 lines
2.5 KiB
INI

[app:main]
use = egg:make_post_sell
pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/${TEST_DATABASE_PATH:-test_make_post_sell.sqlite}
retry.attempts = 3
session.hashalg = sha512
session.secret = test-secret
session.timeout = 31104000
session.max_age = 31104000
session.reissue_time = 15552000
session.samesite = None
app.root_domain = blanka.foxhop.net
app.bucket.secure_uploads = plan-period-files
app.bucket.secure_uploads.region = nyc3
app.bucket.secure_uploads.post_endpoint = https://nyc3.digitaloceanspaces.com
app.bucket.secure_uploads.get_endpoint = https://plan-period-files.nyc3.digitaloceanspaces.com
app.bucket.secure_uploads.access_key = ${MPS_APP_SECURE_UPLOADS_ACCESS_KEY}
app.bucket.secure_uploads.secret_key = ${MPS_APP_SECURE_UPLOADS_SECRET_KEY}
# stripe test mode is enabled for development & disabled by default.
app.stripe.test_mode = True
# Payment method toggles
app.payments.stripe.enabled = True
app.payments.monero.enabled = False
app.payments.paypal.enabled = True
# PayPal sandbox mode for testing
app.paypal.sandbox_mode = True
# Monero RPC Configuration for tests
monero.rpc_url = http://127.0.0.1:18083/json_rpc
monero.rpc_user =
monero.rpc_pass =
monero.account_index = 0
monero.quote_expiry_seconds = 900
monero.rate_source_url = https://api.coingecko.com/api/v3/simple/price?ids=monero&vs_currencies=usd
# Monero confirmation requirements by amount tier
# Note: Payment thresholds are now per-shop settings (default $10 and $100)
monero.confirmations.petty = 2
monero.confirmations.mid = 10
monero.confirmations.high = 20
[pshell]
setup = make_post_sell.scripts.pshell.setup
[alembic]
# path to migration scripts
script_location = make_post_sell:scripts/alembic
sqlalchemy.url = sqlite:///%(here)s/${TEST_DATABASE_PATH:-test_make_post_sell.sqlite}
[server:main]
use = egg:waitress#main
listen = localhost:6502
[loggers]
keys = root, make_post_sell, sqlalchemy
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_make_post_sell]
level = DEBUG
handlers =
qualname = make_post_sell
[logger_sqlalchemy]
level = DEBUG
handlers =
qualname = sqlalchemy.engine
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s