Skip to content

Commit

Permalink
chore: rename test settings and shorten runserver instructions (#6131)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks authored Aug 11, 2023
1 parent 540c489 commit 7313736
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ jobs:
echo "Running tests..."
if [[ "x${{ github.event.inputs.ignoreLowerCoverage }}" == "xtrue" ]]; then
echo "Lower coverage failures will be ignored."
./ietf/manage.py test --validate-html-harder --settings=settings_postgrestest --ignore-lower-coverage
./ietf/manage.py test --validate-html-harder --settings=settings_test --ignore-lower-coverage
else
./ietf/manage.py test --validate-html-harder --settings=settings_postgrestest
./ietf/manage.py test --validate-html-harder --settings=settings_test
fi
coverage xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
exit 1
fi
echo "Running tests..."
./ietf/manage.py test --validate-html-harder --settings=settings_postgrestest
./ietf/manage.py test --validate-html-harder --settings=settings_test
coverage xml
- name: Upload Coverage Results to Codecov
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"args": [
"${workspaceFolder}/ietf/manage.py",
"test",
"--settings=settings_postgrestest"
"--settings=settings_test"
],
"group": "test",
"presentation": {
Expand All @@ -68,7 +68,7 @@
"args": [
"${workspaceFolder}/ietf/manage.py",
"test",
"--settings=settings_postgrestest",
"--settings=settings_test",
"--pattern=tests_js.py"
],
"group": "test",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ If VS Code is not available to you, in your clone, type `cd docker; ./run`
Once the containers are started, run the tests to make sure your checkout is a good place to start from (all tests should pass - if any fail, ask for help at tools-develop@). Inside the app container's shell type:
```sh
ietf/manage.py test --settings=settings_postgrestest
ietf/manage.py test --settings=settings_test
```

Note that we recently moved the datatracker onto PostgreSQL - you may still find older documentation that suggests testing with settings_sqlitetest. That will no longer work.
Expand Down Expand Up @@ -228,7 +228,7 @@ before activating a new release.
From a datatracker container, run the command:
```sh
./ietf/manage.py test --settings=settings_postgrestest
./ietf/manage.py test --settings=settings_test
```

> You can limit the run to specific tests using the `--pattern` argument.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
# UID: 1001
# GID: 1001
# DATADIR: data
# DJANGO_SETTINGS_MODULE: settings_postgrestest
# DJANGO_SETTINGS_MODULE: settings_test

# Uncomment the next line to use a non-root user for all processes.
# user: dev
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
2. Wait for the containers to initialize. Upon completion, you will be dropped into a shell from which you can start the datatracker and execute related commands as usual, for example

```
ietf/manage.py runserver 0.0.0.0:8001
ietf/manage.py runserver 8001
```

to start the datatracker.
Expand Down
2 changes: 1 addition & 1 deletion docker/configs/nginx-502.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>Could not connect to dev server.</h2>
<div>
<p>Is the datatracker server running?</p>
<p class="mt">Using <strong>VS Code</strong>, open the <strong>Run and Debug</strong> tab on the left and click the <i>&#x2023;</i> symbol (Run Server) to start the server.</p>
<p>Otherwise, run the command <code>ietf/manage.py runserver 0.0.0.0:8001</code> from the terminal.</p>
<p>Otherwise, run the command <code>ietf/manage.py runserver 8001</code> from the terminal.</p>
</div>
<div class="mt">
<p>You can manage the database at <a href="/pgadmin">/pgadmin</a>.</p>
Expand Down
4 changes: 2 additions & 2 deletions docker/scripts/app-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ if [ -z "$EDITOR_VSCODE" ]; then
echo
echo "You can execute arbitrary commands now, e.g.,"
echo
echo " ietf/manage.py runserver 0.0.0.0:8001"
echo " ietf/manage.py runserver 8001"
echo
echo "to start a development instance of the Datatracker."
echo
echo " ietf/manage.py test --settings=settings_postgrestest"
echo " ietf/manage.py test --settings=settings_test"
echo
echo "to run all the python tests."
echo
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/db-load-default-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# Adding the extension to the default template is needed to allow the test-suite
# to be run on postgres (see ietf.settings_postgrestest). The test runner always
# to be run on postgres (see ietf.settings_test). The test runner always
# makes a fresh test database instance, and since we are bypassing the migration
# framework and using a fixture to set the database structure, there's no reaonable
# way to install the extension as part of the test run.
Expand Down
2 changes: 1 addition & 1 deletion ietf/settings_postgrestest.py → ietf/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# useful for speeding up tests that depend on the test database, try
# for instance:
#
# ./manage.py test --settings=settings_postgrestest doc.ChangeStateTestCase
# ./manage.py test --settings=settings_test doc.ChangeStateTestCase
#

import os
Expand Down

0 comments on commit 7313736

Please sign in to comment.