From 4deb22f685df09b7b9c1246cf38aabec1f10b42e Mon Sep 17 00:00:00 2001
From: Dariusz Kedzierski <dkedzierski@syncad.com>
Date: Thu, 2 Jul 2020 12:33:30 +0200
Subject: [PATCH] [WIP] More work on pyrest tests for hivemind

- test definitions are now complete,
- benchmark definitions are now complete,

Now we need to add reference json data for tests (in next commits).
---
 .../follow_api/follow_api_benchmark.yaml      |  72 +++++++++-
 .../follow_api/follow_api_test.yaml           |  20 +--
 .../tags_api/tags_api_benchmark.yaml          | 128 +++++++++++++++++-
 .../pyrest_tests/tags_api/tags_api_test.yaml  |  36 ++---
 4 files changed, 226 insertions(+), 30 deletions(-)

diff --git a/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml b/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml
index 9d9bbb916..3a2534c8f 100644
--- a/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml
+++ b/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml
@@ -20,4 +20,74 @@
     - metrics:
       - total_time
       - total_time: mean
-      - total_time: median
\ No newline at end of file
+      - total_time: median
+
+  - benchmark:
+    - name: "get_followers"
+    - variable_binds:
+      - method: "get_followers"
+      - args: {"account":"steemit","start":null,"type":"blog","limit":10}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_following"
+    - variable_binds:
+      - method: "get_following"
+      - args: {"account":"steemit","start":null,"type":"blog","limit":10}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_follow_count"
+    - variable_binds:
+      - method: "get_follow_count"
+      - args: {"account":"steemit"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_account_reputations"
+    - variable_binds:
+      - method: "get_account_reputations"
+      - args: {"account_lower_bound": "steem"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_blog"
+    - variable_binds:
+      - method: "get_blog"
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_blog_entries"
+    - variable_binds:
+      - method: "get_blog_entries"
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_reblogged_by"
+    - variable_binds:
+      - method: "get_reblogged_by"
+      - args: {"author":"steemit","permlink":"firstpost"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_feed_entries"
+    - variable_binds:
+      - method: "get_feed_entries"
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_feed"
+    - variable_binds:
+      - method: "get_feed"
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_blog_authors"
+    - variable_binds:
+      - method: "get_blog_authors"
+      - args: {"blog_account":"steemit"}
+    - <<: *base_benchmark
\ No newline at end of file
diff --git a/tests/pyrest_tests/follow_api/follow_api_test.yaml b/tests/pyrest_tests/follow_api/follow_api_test.yaml
index cf1b56221..468bd5cdc 100644
--- a/tests/pyrest_tests/follow_api/follow_api_test.yaml
+++ b/tests/pyrest_tests/follow_api/follow_api_test.yaml
@@ -24,68 +24,68 @@
     - name: "get_followers"
     - variable_binds:
       - method: "get_followers"
-      - args: {}
+      - args: {"account":"steemit","start":null,"type":"blog","limit":10}
     - <<: *base_test
 
   - test:
     - name: "get_following"
     - variable_binds:
       - method: "get_following"
-      - args: {}
+      - args: {"account":"steemit","start":null,"type":"blog","limit":10}
     - <<: *base_test
 
   - test:
     - name: "get_follow_count"
     - variable_binds:
       - method: "get_follow_count"
-      - args: {}
+      - args: {"account":"steemit"}
     - <<: *base_test
 
   - test:
     - name: "get_account_reputations"
     - variable_binds:
       - method: "get_account_reputations"
-      - args: {}
+      - args: {"account_lower_bound": "steem"}
     - <<: *base_test
 
   - test:
     - name: "get_blog"
     - variable_binds:
       - method: "get_blog"
-      - args: {}
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_blog_entries"
     - variable_binds:
       - method: "get_blog_entries"
-      - args: {}
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_reblogged_by"
     - variable_binds:
       - method: "get_reblogged_by"
-      - args: {}
+      - args: {"author":"steemit","permlink":"firstpost"}
     - <<: *base_test
 
   - test:
     - name: "get_feed_entries"
     - variable_binds:
       - method: "get_feed_entries"
-      - args: {}
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_feed"
     - variable_binds:
       - method: "get_feed"
-      - args: {}
+      - args: {"account":"steemit","start_entry_id":0,"limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_blog_authors"
     - variable_binds:
       - method: "get_blog_authors"
-      - args: {}
+      - args: {"blog_account":"steemit"}
     - <<: *base_test
\ No newline at end of file
diff --git a/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml b/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml
index 9d9bbb916..8158dc1d3 100644
--- a/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml
+++ b/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml
@@ -20,4 +20,130 @@
     - metrics:
       - total_time
       - total_time: mean
-      - total_time: median
\ No newline at end of file
+      - total_time: median
+
+  - benchmark:
+    - name: "get_discussion"
+    - variable_binds:
+      - method: "get_discussion"
+      - args: {"author":"steemit", "permlink":"firstpost"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_content_replies"
+    - variable_binds:
+      - method: "get_content_replies"
+      - args: {"author":"steemit", "permlink":"firstpost"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_trending"
+    - variable_binds:
+      - method: "get_discussions_by_trending"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_hot"
+    - variable_binds:
+      - method: "get_discussions_by_hot"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_promoted"
+    - variable_binds:
+      - method: "get_discussions_by_promoted"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_created"
+    - variable_binds:
+      - method: "get_discussions_by_created"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_blog"
+    - variable_binds:
+      - method: "get_discussions_by_blog"
+      - args: {"tag":"steemit","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_comments"
+    - variable_binds:
+      - method: "get_discussions_by_comments"
+      - args: {"start_author":"steemit","start_permlink":"firstpost","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_author_before_date"
+    - variable_binds:
+      - method: "get_discussions_by_author_before_date"
+      - args: {"author":"steemit","start_permlink":"firstpost","before_date":"2016-04-19T22:49:43","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_post_discussions_by_payout"
+    - variable_binds:
+      - method: "get_post_discussions_by_payout"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_comment_discussions_by_payout"
+    - variable_binds:
+      - method: "get_comment_discussions_by_payout"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_active_votes"
+    - variable_binds:
+      - method: "get_active_votes"
+      - args: {"author":"steemit", "permlink":"firstpost"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_tags_used_by_author"
+    - variable_binds:
+      - method: "get_tags_used_by_author"
+      - args: {"author":"steemit"}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_active"
+    - variable_binds:
+      - method: "get_discussions_by_active"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_cashout"
+    - variable_binds:
+      - method: "get_discussions_by_cashout"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_votes"
+    - variable_binds:
+      - method: "get_discussions_by_votes"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_discussions_by_children"
+    - variable_binds:
+      - method: "get_discussions_by_children"
+      - args: {"tag":"steem","limit":1}
+    - <<: *base_benchmark
+
+  - benchmark:
+    - name: "get_account_votes"
+    - variable_binds:
+      - method: "get_account_votes"
+      - args: {"account":"steemit"}
+    - <<: *base_benchmark
\ No newline at end of file
diff --git a/tests/pyrest_tests/tags_api/tags_api_test.yaml b/tests/pyrest_tests/tags_api/tags_api_test.yaml
index 48871eaf8..0050a9be8 100644
--- a/tests/pyrest_tests/tags_api/tags_api_test.yaml
+++ b/tests/pyrest_tests/tags_api/tags_api_test.yaml
@@ -24,124 +24,124 @@
     - name: "get_discussion"
     - variable_binds:
       - method: "get_discussion"
-      - args: {}
+      - args: {"author":"steemit", "permlink":"firstpost"}
     - <<: *base_test
 
   - test:
     - name: "get_content_replies"
     - variable_binds:
       - method: "get_content_replies"
-      - args: {}
+      - args: {"author":"steemit", "permlink":"firstpost"}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_trending"
     - variable_binds:
       - method: "get_discussions_by_trending"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_hot"
     - variable_binds:
       - method: "get_discussions_by_hot"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_promoted"
     - variable_binds:
       - method: "get_discussions_by_promoted"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_created"
     - variable_binds:
       - method: "get_discussions_by_created"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_blog"
     - variable_binds:
       - method: "get_discussions_by_blog"
-      - args: {}
+      - args: {"tag":"steemit","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_comments"
     - variable_binds:
       - method: "get_discussions_by_comments"
-      - args: {}
+      - args: {"start_author":"steemit","start_permlink":"firstpost","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_author_before_date"
     - variable_binds:
       - method: "get_discussions_by_author_before_date"
-      - args: {}
+      - args: {"author":"steemit","start_permlink":"firstpost","before_date":"2016-04-19T22:49:43","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_post_discussions_by_payout"
     - variable_binds:
       - method: "get_post_discussions_by_payout"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_comment_discussions_by_payout"
     - variable_binds:
       - method: "get_comment_discussions_by_payout"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_active_votes"
     - variable_binds:
       - method: "get_active_votes"
-      - args: {}
+      - args: {"author":"steemit", "permlink":"firstpost"}
     - <<: *base_test
 
   - test:
     - name: "get_tags_used_by_author"
     - variable_binds:
       - method: "get_tags_used_by_author"
-      - args: {}
+      - args: {"author":"steemit"}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_active"
     - variable_binds:
       - method: "get_discussions_by_active"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_cashout"
     - variable_binds:
       - method: "get_discussions_by_cashout"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_votes"
     - variable_binds:
       - method: "get_discussions_by_votes"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_discussions_by_children"
     - variable_binds:
       - method: "get_discussions_by_children"
-      - args: {}
+      - args: {"tag":"steem","limit":1}
     - <<: *base_test
 
   - test:
     - name: "get_account_votes"
     - variable_binds:
       - method: "get_account_votes"
-      - args: {}
+      - args: {"account":"steemit"}
     - <<: *base_test
\ No newline at end of file
-- 
GitLab