Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
7c3408d1
Unverified
Commit
7c3408d1
authored
3 years ago
by
Andrew Morgan
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Document the `SYNAPSE_TEST_PERSIST_SQLITE_DB` unit test env var (#11715)
parent
ffd227c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/11715.doc
+1
-0
1 addition, 0 deletions
changelog.d/11715.doc
docs/development/contributing_guide.md
+21
-0
21 additions, 0 deletions
docs/development/contributing_guide.md
with
22 additions
and
0 deletions
changelog.d/11715.doc
0 → 100644
+
1
−
0
View file @
7c3408d1
Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide.
This diff is collapsed.
Click to expand it.
docs/development/contributing_guide.md
+
21
−
0
View file @
7c3408d1
...
...
@@ -169,6 +169,27 @@ To increase the log level for the tests, set `SYNAPSE_TEST_LOG_LEVEL`:
SYNAPSE_TEST_LOG_LEVEL
=
DEBUG trial tests
```
By default, tests will use an in-memory SQLite database for test data. For additional
help with debugging, one can use an on-disk SQLite database file instead, in order to
review database state during and after running tests. This can be done by setting
the
`SYNAPSE_TEST_PERSIST_SQLITE_DB`
environment variable. Doing so will cause the
database state to be stored in a file named
`test.db`
under the trial process'
working directory. Typically, this ends up being
`_trial_temp/test.db`
. For example:
```
sh
SYNAPSE_TEST_PERSIST_SQLITE_DB
=
1 trial tests
```
The database file can then be inspected with:
```
sh
sqlite3 _trial_temp/test.db
```
Note that the database file is cleared at the beginning of each test run. Thus it
will always only contain the data generated by the
*last run test*
. Though generally
when debugging, one is only running a single test anyway.
### Running tests under PostgreSQL
Invoking
`trial`
as above will use an in-memory SQLite database. This is great for
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment