You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,33 @@ with testgres.get_new_node().init() as master:
173
173
Note that `default_conf()` is called by `init()` function; both of them overwrite
174
174
the configuration file, which means that they should be called before `append_conf()`.
175
175
176
+
### Remote mode
177
+
Testgres supports the creation of PostgreSQL nodes on a remote host. This is useful when you want to run distributed tests involving multiple nodes spread across different machines.
178
+
179
+
To use this feature, you need to use the RemoteOperations class.
180
+
Here is an example of how you might set this up:
181
+
182
+
```python
183
+
from testgres import ConnectionParams, RemoteOperations, TestgresConfig, get_remote_node
184
+
185
+
# Set up connection params
186
+
conn_params = ConnectionParams(
187
+
host='your_host', # replace with your host
188
+
username='user_name', # replace with your username
189
+
ssh_key='path_to_ssh_key'# replace with your SSH key path
190
+
)
191
+
os_ops = RemoteOperations(conn_params)
192
+
193
+
# Add remote testgres config before test
194
+
TestgresConfig.set_os_ops(os_ops=os_ops)
195
+
196
+
# Proceed with your test
197
+
deftest_basic_query(self):
198
+
with get_remote_node(conn_params=conn_params) as node:
0 commit comments