Skip to content

Commit ee0994a

Browse files
authored
Merge pull request #1805 from hashtopolis/pytest-testing
Pytest structure changes and additional tests for Pretask
2 parents cae6fbe + 81b6ec4 commit ee0994a

35 files changed

+227
-355
lines changed

ci/apiv2/DEBUGGING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#### Examples
2+
3+
Common sequences of commands used in development setups
4+
5+
Initialize token:
6+
```
7+
TOKEN=$(curl -X POST --user admin:hashtopolis http://localhost:8080/api/v2/auth/token | jq -r .token)
8+
```
9+
10+
Fetch object:
11+
```
12+
curl --compressed --header "Authorization: Bearer $TOKEN" -g 'http://localhost:8080/api/v2/ui/hashtypes?page[size]=5'
13+
```
14+
15+
Access database (MySQL):
16+
```
17+
mysql -u $HASHTOPOLIS_DB_USER -p$HASHTOPOLIS_DB_PASS -h $HASHTOPOLIS_DB_HOST -D $HASHTOPOLIS_DB_DATABASE
18+
```
19+
20+
Access database (PostgreSQL):
21+
```
22+
psql -U${HASHTOPOLIS_DB_USER} -h${HASHTOPOLIS_DB_HOST}
23+
```
24+
25+
Enable query logging:
26+
```
27+
docker exec $(docker ps -aqf "ancestor=mysql:8.0") mysql -u root -phashtopolis -e "SET global log_output = 'FILE'; SET global general_log_file='/tmp/mysql_all.log'; SET global general_log = 1;"
28+
docker exec $(docker ps -aqf "ancestor=mysql:8.0") tail -f /tmp/mysql_all.log
29+
```
30+
31+
Shortcut for testing within development setup:
32+
```
33+
cd ~/src/hashtopolis/server/ci/apiv2
34+
pytest --exitfirst --last-failed
35+
```
36+
37+
Run a specific test from the terminal
38+
```
39+
cd /var/www/html/ci/apiv2 && python3 -m pytest test_task.py::TaskTest::test_toggle_archive_task_supertask_type -v -s
40+
```

ci/apiv2/HACKING.md

Lines changed: 0 additions & 145 deletions
This file was deleted.

ci/apiv2/PERMISSIONS_REWORK.md

Lines changed: 0 additions & 194 deletions
This file was deleted.

ci/apiv2/poc_openapi_perm_test.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)