Skip to content

Commit 236d27b

Browse files
committed
document running tests
1 parent 37bb290 commit 236d27b

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- omit in toc -->
12
# dsd-pythonanywhere
23

34
A plugin for deploying Django projects to [PythonAnywhere](https://www.pythonanywhere.com/), using django-simple-deploy.
@@ -8,6 +9,11 @@ For full documentation, see the documentation for [django-simple-deploy](https:/
89
repository to PythonAnywhere, but it doesn't configure the web app just yet. Not
910
yet recommended for actual deployments yet.
1011

12+
- [Motivation](#motivation)
13+
- [Quickstart](#quickstart)
14+
- [Plugin Development](#plugin-development)
15+
- [Automated Tests](#automated-tests)
16+
1117
## Motivation
1218

1319
This plugin hopes to provide a deployment option for `django-simple-deploy` that
@@ -32,7 +38,15 @@ requires a few prerequisites:
3238
## Plugin Development
3339

3440
To set up a development environment for working on this plugin alongside
35-
`django-simple-deploy`, follow these steps.
41+
`django-simple-deploy`, follow these steps. This will create a directory
42+
structure that looks like this:
43+
44+
```sh
45+
dsd-dev/
46+
├── django-simple-deploy # ← parent project needed to run integration tests
47+
├── dsd-pythonanywhere # ← our plugin development directory
48+
└── dsd-dev-project_[random_string] # ← sample project for testing deployments
49+
```
3650

3751
1. Create a parent directory to hold your development work:
3852

@@ -53,15 +67,15 @@ git clone [email protected]:caktus/dsd-pythonanywhere.git
5367
```sh
5468
git clone [email protected]:django-simple-deploy/django-simple-deploy.git
5569
cd django-simple-deploy/
56-
# Builds a copy of the sample project in parent dir for testing (../dsd-dev-project-[random_string]/)
70+
# Builds a copy of the sample project in parent dir for testing (../dsd-dev-project_[random_string]/)
5771
uv run python tests/e2e_tests/utils/build_dev_env.py
5872
```
5973

6074
4. Setup the development environment:
6175

6276
```sh
6377
cd ../
64-
cd dsd-dev-project-[random_string]/
78+
cd dsd-dev-project_[random_string]/
6579
source .venv/bin/activate
6680
# Install dsd-pythonanywhere plugin in editable mode
6781
pip install -e "../dsd-pythonanywhere/[dev]"
@@ -135,3 +149,25 @@ in your sample project to point to the ngrok URL for `scripts/setup.sh`:
135149
```sh
136150
export REMOTE_SETUP_SCRIPT_URL="https://<your_ngrok_subdomain>.ngrok-free.app/scripts/setup.sh"
137151
```
152+
153+
### Automated Tests
154+
155+
To run the unit tests for this plugin, run:
156+
157+
```sh
158+
cd dsd-pythonanywhere/
159+
uv run pytest
160+
```
161+
162+
To run the integration tests (and unit tests), which exercise the mechanics of
163+
`python manage.py deploy` locally without actually deploying to PythonAnywhere,
164+
run:
165+
166+
```sh
167+
cd django-simple-deploy/
168+
# Install dsd-pythonanywhere plugin in editable mode
169+
uv add --editable "../dsd-pythonanywhere[dev]"
170+
uv run pytest
171+
# To skip platform_agnostic_tests for faster feedback during plugin development:
172+
uv run pytest --ignore=tests/integration_tests/platform_agnostic_tests
173+
```

0 commit comments

Comments
 (0)