Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
David Douard
swh-web
Commits
ce057e11
Commit
ce057e11
authored
3 months ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
setting/cypress: use django OPTIONS for sqlite instead of a connection hook
parent
034f1877
No related branches found
No related tags found
No related merge requests found
Pipeline
#12624
failed
3 months ago
Stage: external
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/settings/cypress.py
+10
-11
10 additions, 11 deletions
swh/web/settings/cypress.py
with
10 additions
and
11 deletions
swh/web/settings/cypress.py
+
10
−
11
View file @
ce057e11
# Copyright (C) 2017-202
4
The Software Heritage developers
# Copyright (C) 2017-202
5
The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
...
...
@@ -9,7 +9,6 @@ Django tests settings for cypress e2e tests.
import
os
from
django.conf
import
settings
from
django.db.backends.signals
import
connection_created
from
swh.scheduler
import
get_scheduler
from
swh.web.config
import
get_config
...
...
@@ -55,18 +54,18 @@ settings.DATABASES["default"].update(
{
"
ENGINE
"
:
"
django.db.backends.sqlite3
"
,
"
NAME
"
:
f
"
swh-web-test
{
build_id
}
.sqlite3
"
,
"
OPTIONS
"
:
{
"
transaction_mode
"
:
"
IMMEDIATE
"
,
"
init_command
"
:
(
"
PRAGMA journal_mode=WAL;
"
"
PRAGMA synchronous=NORMAL;
"
"
PRAGMA cache_size=2000;
"
"
PRAGMA busy_timeout=5000
"
),
},
}
)
# to prevent "database is locked" error when running cypress tests
def
activate_wal_journal_mode
(
sender
,
connection
,
**
kwargs
):
cursor
=
connection
.
cursor
()
cursor
.
execute
(
"
PRAGMA journal_mode = WAL;
"
)
connection_created
.
connect
(
activate_wal_journal_mode
)
DEBUG
=
swh_web_config
[
"
debug
"
]
DEBUG_PROPAGATE_EXCEPTIONS
=
swh_web_config
[
"
debug
"
]
...
...
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