File tree Expand file tree Collapse file tree 3 files changed +47
-21
lines changed Expand file tree Collapse file tree 3 files changed +47
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Persistence Tests
2+
3+ Torrust requires Docker to run different database systems for testing.
4+
5+ Start the databases with ` docker-compose ` before running tests:
6+
7+ ``` s
8+ docker-compose -f tests/databases/docker-compose.yml up
9+ ```
10+
11+ Run all tests using:
12+
13+ ``` s
14+ cargo test
15+ ```
16+
17+ Connect to the DB using MySQL client:
18+
19+ ``` s
20+ mysql -h127.0.0.1 -uroot -ppassword torrust-index_test
21+ ```
22+
23+ Right now only tests for MySQLite are executed. To run tests for MySQL too,
24+ you have to replace this line in ` tests/databases/mysql.rs ` :
25+
26+ ``` rust
27+
28+ ```rust
29+ #[tokio:: test]
30+ #[should_panic]
31+ async fn run_mysql_tests () {
32+ panic! (" Todo Test Times Out!" );
33+ #[allow(unreachable_code)]
34+ {
35+ run_tests (DATABASE_URL ). await ;
36+ }
37+ }
38+ ```
39+
40+ with this:
41+
42+ ``` rust
43+ #[tokio:: test]
44+ async fn run_mysql_tests () {
45+ run_tests (DATABASE_URL ). await ;
46+ }
47+ ```
File renamed without changes.
You can’t perform that action at this time.
0 commit comments