Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
Jenkins jobs
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
Jenkins jobs
Commits
bf0022ad
Commit
bf0022ad
authored
2 months ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
cypress: use DJANGO_SETTINGS_MODULE if defined when running django commands
parent
210dc5d5
No related branches found
No related tags found
No related merge requests found
Pipeline
#12612
passed
2 months ago
Stage: external
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jobs/templates/includes/stage-cypress-tests.groovy.j2
+3
-3
3 additions, 3 deletions
jobs/templates/includes/stage-cypress-tests.groovy.j2
with
3 additions
and
3 deletions
jobs/templates/includes/stage-cypress-tests.groovy.j2
+
3
−
3
View file @
bf0022ad
...
@@ -15,10 +15,10 @@ stage('Cypress tests') {
...
@@ -15,10 +15,10 @@ stage('Cypress tests') {
rm -f swh-web-test*.sqlite3*
rm -f swh-web-test*.sqlite3*
# apply django migrations and create users (will produce swh-web-test.sqlite3 file)
# apply django migrations and create users (will produce swh-web-test.sqlite3 file)
python{{cypress_python_version}} swh/web/manage.py migrate --settings=swh.web.settings.tests
python{{cypress_python_version}} swh/web/manage.py migrate --settings=
${DJANGO_SETTINGS_MODULE:-
swh.web.settings.tests
}
for create_users_script in swh/web/tests/create_test_*
for create_users_script in swh/web/tests/create_test_*
do
do
cat $create_users_script | python{{cypress_python_version}} swh/web/manage.py shell --settings=swh.web.settings.tests
cat $create_users_script | python{{cypress_python_version}} swh/web/manage.py shell --settings=
${DJANGO_SETTINGS_MODULE:-
swh.web.settings.tests
}
done
done
# build swh-web static assets in test mode (for code coverage)
# build swh-web static assets in test mode (for code coverage)
...
@@ -56,7 +56,7 @@ stage('Cypress tests') {
...
@@ -56,7 +56,7 @@ stage('Cypress tests') {
cp swh-web-test.sqlite3 swh-web-test{{ n }}.sqlite3
cp swh-web-test.sqlite3 swh-web-test{{ n }}.sqlite3
# run django server on a dedicated port for that test runner and wait for it to be up
# run django server on a dedicated port for that test runner and wait for it to be up
python{{cypress_python_version}} swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests 0.0.0.0:500{{ n }}&
python{{cypress_python_version}} swh/web/manage.py runserver --nostatic --settings=
${DJANGO_SETTINGS_MODULE:-
swh.web.settings.tests
}
0.0.0.0:500{{ n }}&
wait-for-it -t 90 localhost:500{{ n }}
wait-for-it -t 90 localhost:500{{ n }}
# execute cypress tests
# execute cypress tests
...
...
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