forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TimescaleNode subclasses for TAP Testing
Use subclassing to inherit from `PostgresNode` and create a hierarchy containing `AccessNode` and `DataNode` to simplify creating tests with multiple nodes. Also, two new functions are added: `TimescaleNode::create`: Creates the new node by calling `get_new_node`, `init` and `start` in that order. `AccessNode::add_data_node`: Adds a new data node to the access node. Also rewrite the test to use the new hierarchy.
- Loading branch information
Showing
4 changed files
with
53 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file and its contents are licensed under the Timescale License. | ||
# Please see the included NOTICE for copyright information and | ||
# LICENSE-TIMESCALE for a copy of the license. | ||
|
||
package AccessNode; | ||
use parent qw(TimescaleNode); | ||
use strict; | ||
use warnings; | ||
|
||
sub add_data_node | ||
{ | ||
my ($self, $dn) = @_; | ||
my $name = $dn->name; | ||
my $host = $dn->host; | ||
my $port = $dn->port; | ||
$self->safe_psql('postgres', | ||
"SELECT add_data_node('$name', host => '$host', port => $port)"); | ||
return $self; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file and its contents are licensed under the Timescale License. | ||
# Please see the included NOTICE for copyright information and | ||
# LICENSE-TIMESCALE for a copy of the license. | ||
|
||
package DataNode; | ||
use parent qw(TimescaleNode); | ||
use strict; | ||
use warnings; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters