-
Notifications
You must be signed in to change notification settings - Fork 367
Logging database queries in unit tests
Chris Selzo edited this page Jun 26, 2018
·
1 revision
Sometimes you wanna see what Sequel is up to when you're SELECTing, FROMing, and/or WHEREing in your unit tests. The logs for all your unit tests appear in spec/artifacts/spec.log. You may want to delete this periodically as it is appended to and can get quite large!
To set up db query logging:
- Open
spec/support/bootstrap/db_config.rband addlog_db_queries: true,to the hash returned by theconfigmethod - Run your test, and
tail -forlessor whateverspec/artifacts/spec.log - There's no step 3
-
Pipelines
-
Contributing
- Tips and Tricks
- Cloud Controller API v3 Style Guide
- Playbooks
- Development configuration
- Testing
-
Architectural Details
-
CC Resources
- Apps
- Audit Events
- Deployments
- Labels
- Services
- Sidecars
-
Dependencies
-
Troubleshooting
- Ruby Console Script to Find Fields that Cannot Be Decrypted
- Logging database queries in unit tests
- Inspecting blobstore cc resources and cc packages(webdav)
- How to Use USR1 Trap for Diagnostics
- How to Perf: Finding and Fixing Bottlenecks
- How to get access to mysql database
- How To Get a Ruby Heap Dumps & GC Stats from CC
- How to curl v4 internal endpoints with mtls
- How to access Bosh Director console and restore an outdated Cloud Config
- Analyzing Cloud Controller's NGINX logs using the toplogs script
-
k8s
-
Archive