Skip to content

Commit 6947f60

Browse files
authored
chore: add PyCharm run template for pytest (#788)
Run tests directly from PyCharm, with jump to source in tests errors
1 parent 3a2bea7 commit 6947f60

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

.idea/runConfigurations/_template__of_py_test.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.local_env

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export DATA_SERVICE_ROOT=$(cd "$(dirname ${0})"; pwd)
2+
3+
export KUBECONFIG="${DATA_SERVICE_ROOT}/.k3d-config.yaml"
4+
5+
export NB_SERVER_OPTIONS__DEFAULTS_PATH="${DATA_SERVICE_ROOT}/server_defaults.json"
6+
export NB_SERVER_OPTIONS__UI_CHOICES_PATH="${DATA_SERVICE_ROOT}/server_options.json"
7+
export CORS_ALLOW_ALL_ORIGINS=true
8+
9+
export ALEMBIC_CONFIG="${DATA_SERVICE_ROOT}/components/renku_data_services/migrations/alembic.ini"
10+
11+
export AUTHZ_DB_GRPC_PORT=50051
12+
export AUTHZ_DB_HOST=127.0.0.1
13+
export AUTHZ_DB_KEY=renku
14+
export AUTHZ_DB_NO_TLS_CONNECTION=true
15+
16+
export DB_HOST=127.0.0.1
17+
export DB_NAME=renku
18+
export DB_PASSWORD=renku
19+
export DB_USER=renku
20+
21+
export ZED_TOKEN=renku
22+
export ZED_ENDPOINT=127.0.0.1:50051
23+
export ZED_INSECURE=true
24+
25+
export SOLR_URL="http://127.0.0.1:8983"
26+
export SOLR_CORE="renku-search-dev"

DEVELOPING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@ To update the snapshot data, run the following command in the devcontainer:
121121
$ poetry run pytest -m "not schemathesis" -n auto --snapshot-update
122122
```
123123

124+
### Directly from PyCharm
125+
126+
From the root folder of the repository, run:
127+
128+
1. `devcontainer build --workspace-folder .`
129+
2. `devcontainer up --workspace-folder .`
130+
3. `make schemas`
131+
4. `make amalthea_schema`
132+
133+
> **WARNING:**
134+
>
135+
> Be careful with the kubernetes environment in your shell, as in case of badly setup tests and environment you might try
136+
> to run some tests against your default cluster.
137+
138+
Then you can run the test as usual directly from PyCharm by clicking on the green arrow next to a specific test, or a
139+
whole test suite or part of the test hierarchy.
140+
124141
## Migrations
125142

126143
We use Alembic for migrations, and we have a single version table for all schemas. This version table

0 commit comments

Comments
 (0)