summaryrefslogtreecommitdiff
path: root/tests/server-tests/order.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-08-29 16:35:14 -0700
committerelijah <elijah@riseup.net>2016-09-01 10:13:31 -0700
commit07c0e60e6bdc5b8bfe1f42f76dae9f0a79e7abb0 (patch)
tree9f79f8fbb207896dcfe38f24831d9b2b857199a4 /tests/server-tests/order.rb
parentd5bac5850e4a895da5f9cfacb641fab15de1cf7b (diff)
moved infrastructure tests run by `leap run` to tests/server-tests
Diffstat (limited to 'tests/server-tests/order.rb')
-rw-r--r--tests/server-tests/order.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/server-tests/order.rb b/tests/server-tests/order.rb
new file mode 100644
index 00000000..14aad9be
--- /dev/null
+++ b/tests/server-tests/order.rb
@@ -0,0 +1,22 @@
+class LeapCli::Config::Node
+ #
+ # returns a list of node names that should be tested before this node.
+ # make sure to not return ourselves (please no dependency loops!).
+ #
+ # NOTE: this method determines the order that nodes are tested in. To specify
+ # the order of tests on a particular node, each test can call class method
+ # LeapTest.depends_on().
+ #
+ def test_dependencies
+ dependents = LeapCli::Config::ObjectList.new
+
+ # webapp, mx, and soledad depend on couchdb nodes
+ if services.include?('webapp') || services.include?('mx') || services.include?('soledad')
+ if !services.include?('couchdb')
+ dependents.merge! nodes_like_me[:services => 'couchdb']
+ end
+ end
+
+ dependents.keys.delete_if {|name| self.name == name}
+ end
+end \ No newline at end of file