Skip to content

Commit

Permalink
Fix REST API tests (#4279)
Browse files Browse the repository at this point in the history
* Conftest: check values instead of keys

* Rename SQL script for db restoring

* Use SQL dump file instead of custom format

* Use SQL dump file instead of custom format

* Update README

* Conftest: fix scope for restore_db
  • Loading branch information
Kirill Sizov authored Feb 3, 2022
1 parent 61787ce commit 58a71a4
Show file tree
Hide file tree
Showing 5 changed files with 6,336 additions and 13 deletions.
6 changes: 3 additions & 3 deletions tests/rest_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for i, color in enumerate(colormap):
To backup DB and data volume, please use commands below.

```console
docker exec cvat_db pg_dump -c -C -Fc -U root -d cvat > assets/cvat_db.dump
docker exec cvat_db pg_dump -c -Fp -U root -d cvat > assets/cvat_db/cvat_db.sql
docker run --rm --volumes-from cvat ubuntu tar -cjv /home/django/data > assets/cvat_data.tar.bz2
```

Expand All @@ -81,7 +81,7 @@ python utils/dump_objects.py
To restore DB and data volume, please use commands below.

```console
cat assets/cvat_db/cvat_db.dump | docker exec -i cvat_db pg_restore -1 -c -U root -d cvat
cat assets/cvat_db/cvat_db.sql | docker exec -i cvat_db psql -U root -d cvat
cat assets/cvat_data.tar.bz2 | docker run --rm -i --volumes-from cvat ubuntu tar -xj --strip 3 -C /home/django/data
```

Expand All @@ -93,7 +93,7 @@ cat assets/cvat_data.tar.bz2 | docker run --rm -i --volumes-from cvat ubuntu tar
you have json description of all objects together with cvat_db.sql, it will
be possible to recreate them manually.

1. How to upgrade cvat_data.tar.bz2 and cvat_db.dump?
1. How to upgrade cvat_data.tar.bz2 and cvat_db.sql?

After every commit which changes the layout of DB and data directory it is
possible to break these files. But failed tests should be a clear indicator
Expand Down
Binary file removed tests/rest_api/assets/cvat_db/cvat_db.dump
Binary file not shown.
Loading

0 comments on commit 58a71a4

Please sign in to comment.