File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,18 @@ The above commands will leave a running ScyllaDB cluster in the background.
49
49
To stop it, use ` make down ` .\
50
50
Starting a cluster without running any test is possible with ` make up ` .
51
51
52
+ ### Writing tests that need to connect to Scylla
53
+
54
+ If you test requires connecting to Scylla, there are a few things you should consider.
55
+
56
+ 1 . Such tests are considered integration tests and should be placed in ` scylla/tests/integration ` .
57
+ 2 . To avoid name conflicts while creating a keyspace use ` unique_keyspace_name ` function from ` utils ` module.
58
+ 3 . This ` utils ` module (` scylla/tests/integration/utils.rs ` ) contains other functions that may be helpful for writing tests.
59
+ For example ` create_new_session_builder ` or ` test_with_3_node_cluster ` .
60
+ 4 . To perform DDL queries (creating / altering / dropping a keyspace / table /type) use ` ddl ` method from the utils module.
61
+ To do this, import the ` PerformDDL ` trait (` use crate::utils::PerformDDL; ` ). Then you can call ` ddl ` method on a
62
+ ` Session ` .
63
+
52
64
### Tracing in tests
53
65
54
66
By default cargo captures ` print! ` macro's output from tests and prints them for failed tests.
You can’t perform that action at this time.
0 commit comments