From 5ab85726310543dd0f34289df6a681411673a6e6 Mon Sep 17 00:00:00 2001 From: Dariusz Kedzierski <dkedzierski@syncad.com> Date: Wed, 1 Jul 2020 13:25:31 +0200 Subject: [PATCH] [WIP] Continued work on pyrest tests for hivemind - updated tests bodies, - added benchmarks for some API, More test and benchmarks in next commit. --- tests/pyrest_tests/basic_smoketest.yaml | 2 +- .../bridge_api/bridge_api_benchmark.yaml | 156 ++++++++++++++ .../bridge_api/bridge_api_test.yaml | 31 ++- .../condenser_api_benchmark.yaml | 191 ++++++++++++++++++ .../condenser_api/condenser_api_test.yaml | 48 ++--- .../database_api/database_api_benchmark.yaml | 37 ++++ .../database_api/database_api_test.yaml | 6 +- .../follow_api/follow_api_benchmark.yaml | 23 +++ .../follow_api/follow_api_test.yaml | 2 +- .../hive_api/hive_api_benchmark.yaml | 31 +++ .../pyrest_tests/hive_api/hive_api_test.yaml | 8 +- tests/pyrest_tests/run_api_tests.sh | 23 ++- .../tags_api/tags_api_benchmark.yaml | 23 +++ .../pyrest_tests/tags_api/tags_api_test.yaml | 2 +- 14 files changed, 533 insertions(+), 50 deletions(-) create mode 100644 tests/pyrest_tests/bridge_api/bridge_api_benchmark.yaml create mode 100644 tests/pyrest_tests/condenser_api/condenser_api_benchmark.yaml create mode 100644 tests/pyrest_tests/database_api/database_api_benchmark.yaml create mode 100644 tests/pyrest_tests/follow_api/follow_api_benchmark.yaml create mode 100644 tests/pyrest_tests/hive_api/hive_api_benchmark.yaml create mode 100644 tests/pyrest_tests/tags_api/tags_api_benchmark.yaml diff --git a/tests/pyrest_tests/basic_smoketest.yaml b/tests/pyrest_tests/basic_smoketest.yaml index 282d730aa..1db1add1e 100644 --- a/tests/pyrest_tests/basic_smoketest.yaml +++ b/tests/pyrest_tests/basic_smoketest.yaml @@ -4,6 +4,6 @@ - test: - name: "Test ip address" - group: "basic_smoketest" - - url: "/rpc" + - url: "/" - method: "POST" - body: '{}' diff --git a/tests/pyrest_tests/bridge_api/bridge_api_benchmark.yaml b/tests/pyrest_tests/bridge_api/bridge_api_benchmark.yaml new file mode 100644 index 000000000..7f6a234c1 --- /dev/null +++ b/tests/pyrest_tests/bridge_api/bridge_api_benchmark.yaml @@ -0,0 +1,156 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - total_time: median + + - benchmark: + - name: "normalize_post" + - variable_binds: + - method: "normalize_post" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "get_post_header" + - variable_binds: + - method: "get_post_header" + - args: {"author":"steemit", "permlink":"firstpost"} + - <<: *base_benchmark + + - benchmark: + - name: "get_discussion" + - variable_binds: + - method: "get_discussion" + - args: {"author":"steemit", "permlink":"firstpost"} + - <<: *base_benchmark + + - benchmark: + - name: "get_post" + - variable_binds: + - method: "get_post" + - args: {"author":"steemit", "permlink":"firstpost"} + - <<: *base_benchmark + + - benchmark: + - name: "get_account_posts" + - variable_binds: + - method: "get_account_posts" + - args: {"sort":"post", "account":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "get_ranked_posts" + - variable_binds: + - method: "get_ranked_posts" + - args: {"sort":"trending","tag":"","observer":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "get_profile" + - variable_binds: + - method: "get_profile" + - args: {"account":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "get_trending_topics" + - variable_binds: + - method: "get_trending_topics" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "post_notifications" + - variable_binds: + - method: "post_notifications" + - args: {"author":"steemit", "permlink":"firstpost"} + - <<: *base_benchmark + + - benchmark: + - name: "account_notifications" + - variable_binds: + - method: "account_notifications" + - args: {"account":"steemit","limit":100} + - <<: *base_benchmark + + - benchmark: + - name: "unread_notifications" + - variable_binds: + - method: "unread_notifications" + - args: {"account":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "get_payout_stats" + - variable_binds: + - method: "get_payout_stats" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "get_community" + - variable_binds: + - method: "get_community" + - args: {"name":"hive-123456","observer":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "get_community_context" + - variable_binds: + - method: "get_community_context" + - args: {"community":"hive-123456", "account":"steemit"} + - <<: *base_benchmark + + - benchmark: + - name: "list_communities" + - variable_binds: + - method: "list_communities" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "list_pop_communities" + - variable_binds: + - method: "list_pop_communities" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "list_community_roles" + - variable_binds: + - method: "list_community_roles" + - args: {"community":"hive-123456"} + - <<: *base_benchmark + + - benchmark: + - name: "list_subscribers" + - variable_binds: + - method: "list_subscribers" + - args: {"community":"hive-123456"} + - <<: *base_benchmark + + - benchmark: + - name: "list_all_subscriptions" + - variable_binds: + - method: "list_all_subscriptions" + - args: {"account":"steemit"} + - <<: *base_benchmark \ No newline at end of file diff --git a/tests/pyrest_tests/bridge_api/bridge_api_test.yaml b/tests/pyrest_tests/bridge_api/bridge_api_test.yaml index 3be66891b..9c4e7891e 100644 --- a/tests/pyrest_tests/bridge_api/bridge_api_test.yaml +++ b/tests/pyrest_tests/bridge_api/bridge_api_test.yaml @@ -11,7 +11,7 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: @@ -31,43 +31,42 @@ - name: "get_post_header" - variable_binds: - method: "get_post_header" - - args: {} + - args: {"author":"steemit", "permlink":"firstpost"} - <<: *base_test - test: - name: "get_discussion" - variable_binds: - method: "get_discussion" - - args: {} + - args: {"author":"steemit", "permlink":"firstpost"} - <<: *base_test - test: - name: "get_post" - variable_binds: - method: "get_post" - - args: {} + - args: {"author":"steemit", "permlink":"firstpost"} - <<: *base_test - test: - name: "get_account_posts" - variable_binds: - method: "get_account_posts" - - args: {} + - args: {"sort":"post", "account":"steemit"} - <<: *base_test - - test: - name: "get_ranked_posts" - variable_binds: - method: "get_ranked_posts" - - args: {} + - args: {"sort":"trending","tag":"","observer":"steemit"} - <<: *base_test - test: - name: "get_profile" - variable_binds: - method: "get_profile" - - args: {} + - args: {"account":"steemit"} - <<: *base_test - test: @@ -81,21 +80,21 @@ - name: "post_notifications" - variable_binds: - method: "post_notifications" - - args: {} + - args: {"author":"steemit", "permlink":"firstpost"} - <<: *base_test - test: - name: "account_notifications" - variable_binds: - method: "account_notifications" - - args: {} + - args: {"account":"steemit","limit":100} - <<: *base_test - test: - name: "unread_notifications" - variable_binds: - method: "unread_notifications" - - args: {} + - args: {"account":"steemit"} - <<: *base_test - test: @@ -109,14 +108,14 @@ - name: "get_community" - variable_binds: - method: "get_community" - - args: {} + - args: {"name":"hive-123456","observer":"steemit"} - <<: *base_test - test: - name: "get_community_context" - variable_binds: - method: "get_community_context" - - args: {} + - args: {"community":"hive-123456", "account":"steemit"} - <<: *base_test - test: @@ -137,19 +136,19 @@ - name: "list_community_roles" - variable_binds: - method: "list_community_roles" - - args: {} + - args: {"community":"hive-123456"} - <<: *base_test - test: - name: "list_subscribers" - variable_binds: - method: "list_subscribers" - - args: {} + - args: {"community":"hive-123456"} - <<: *base_test - test: - name: "list_all_subscriptions" - variable_binds: - method: "list_all_subscriptions" - - args: {} + - args: {"account":"steemit"} - <<: *base_test \ No newline at end of file diff --git a/tests/pyrest_tests/condenser_api/condenser_api_benchmark.yaml b/tests/pyrest_tests/condenser_api/condenser_api_benchmark.yaml new file mode 100644 index 000000000..a97c38003 --- /dev/null +++ b/tests/pyrest_tests/condenser_api/condenser_api_benchmark.yaml @@ -0,0 +1,191 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - 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_content" + - variable_binds: + - method: "get_content" + - 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_state" + - variable_binds: + - method: "get_state" + - args: {} + - <<: *base_benchmark + + - benchmark: + - name: "get_trending_tags" + - variable_binds: + - method: "get_trending_tags" + - args: {"start_tag":"steem","limit":10} + - <<: *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_feed" + - variable_binds: + - method: "get_discussions_by_feed" + - args: {"tag":"steem","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_replies_by_last_update" + - variable_binds: + - method: "get_replies_by_last_update" + - args: {"start_parent_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_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_account_reputations" + - variable_binds: + - method: "get_account_reputations" + - args: {"account_lower_bound": "steem"} + - <<: *base_benchmark + + - benchmark: + - name: "get_reblogged_by" + - variable_binds: + - method: "get_reblogged_by" + - args: {"author":"steemit","permlink":"firstpost"} + - <<: *base_benchmark + + - benchmark: + - name: "get_accounts" + - variable_binds: + - method: "get_accounts" + - args: {["steemit"]} + - <<: *base_benchmark + + - benchmark: + - name: "get_account_votes" + - variable_binds: + - method: "get_account_votes" + - args: {["steemit"]} + - <<: *base_benchmark \ No newline at end of file diff --git a/tests/pyrest_tests/condenser_api/condenser_api_test.yaml b/tests/pyrest_tests/condenser_api/condenser_api_test.yaml index 47c106124..769a954f1 100644 --- a/tests/pyrest_tests/condenser_api/condenser_api_test.yaml +++ b/tests/pyrest_tests/condenser_api/condenser_api_test.yaml @@ -11,7 +11,7 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: @@ -24,35 +24,35 @@ - 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_content" - variable_binds: - method: "get_content" - - 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: @@ -66,124 +66,124 @@ - name: "get_trending_tags" - variable_binds: - method: "get_trending_tags" - - args: {} + - args: {"start_tag":"steem","limit":10} - <<: *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_feed" - variable_binds: - method: "get_discussions_by_feed" - - args: {} + - args: {"tag":"steem","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_replies_by_last_update" - variable_binds: - method: "get_replies_by_last_update" - - args: {} + - args: {"start_parent_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_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_account_reputations" - variable_binds: - method: "get_account_reputations" - - args: {} + - args: {"account_lower_bound": "steem"} - <<: *base_test - test: - name: "get_reblogged_by" - variable_binds: - method: "get_reblogged_by" - - args: {} + - args: {"author":"steemit","permlink":"firstpost"} - <<: *base_test - test: - name: "get_accounts" - variable_binds: - method: "get_accounts" - - args: {} + - args: {["steemit"]} - <<: *base_test - test: - name: "get_account_votes" - variable_binds: - method: "get_account_votes" - - args: {} + - args: {["steemit"]} - <<: *base_test \ No newline at end of file diff --git a/tests/pyrest_tests/database_api/database_api_benchmark.yaml b/tests/pyrest_tests/database_api/database_api_benchmark.yaml new file mode 100644 index 000000000..c7e3d936b --- /dev/null +++ b/tests/pyrest_tests/database_api/database_api_benchmark.yaml @@ -0,0 +1,37 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - total_time: median + + - benchmark: + - name: "list_comments" + - variable_binds: + - method: "list_comments" + - args: {"start":["steemit","firstpost","",""], "limit":10, "order":"by_permlink"} + - <<: *base_benchmark + + - benchmark: + - name: "find_comments" + - variable_binds: + - method: "find_comments" + - args: {"start":[["steemit","firstpost"],["steemit","firstpost"]], "limit":10, "order":"by_account"} + - <<: *base_benchmark \ No newline at end of file diff --git a/tests/pyrest_tests/database_api/database_api_test.yaml b/tests/pyrest_tests/database_api/database_api_test.yaml index 27d3e01ab..66eb07d7b 100644 --- a/tests/pyrest_tests/database_api/database_api_test.yaml +++ b/tests/pyrest_tests/database_api/database_api_test.yaml @@ -11,7 +11,7 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: @@ -24,12 +24,12 @@ - name: "list_comments" - variable_binds: - method: "list_comments" - - args: {} + - args: {"start":["steemit","firstpost","",""], "limit":10, "order":"by_permlink"} - <<: *base_test - test: - name: "find_comments" - variable_binds: - method: "find_comments" - - args: {} + - args: {"start":[["steemit","firstpost"],["steemit","firstpost"]], "limit":10, "order":"by_account"} - <<: *base_test diff --git a/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml b/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml new file mode 100644 index 000000000..9d9bbb916 --- /dev/null +++ b/tests/pyrest_tests/follow_api/follow_api_benchmark.yaml @@ -0,0 +1,23 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - total_time: median \ 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 59bc3f005..cf1b56221 100644 --- a/tests/pyrest_tests/follow_api/follow_api_test.yaml +++ b/tests/pyrest_tests/follow_api/follow_api_test.yaml @@ -11,7 +11,7 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: diff --git a/tests/pyrest_tests/hive_api/hive_api_benchmark.yaml b/tests/pyrest_tests/hive_api/hive_api_benchmark.yaml new file mode 100644 index 000000000..d7d3b4868 --- /dev/null +++ b/tests/pyrest_tests/hive_api/hive_api_benchmark.yaml @@ -0,0 +1,31 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - total_time: median + + - benchmark: + - name: "db_head_state" + - variable_binds: + - method: "db_head_state" + - args: {} + - <<: *base_benchmark + diff --git a/tests/pyrest_tests/hive_api/hive_api_test.yaml b/tests/pyrest_tests/hive_api/hive_api_test.yaml index 9884da30c..f63ac4cce 100644 --- a/tests/pyrest_tests/hive_api/hive_api_test.yaml +++ b/tests/pyrest_tests/hive_api/hive_api_test.yaml @@ -11,18 +11,20 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: - extract_test: {jsonpath_mini: "error", test: "not_exists"} - extract_test: {jsonpath_mini: "result", test: "exists"} + - extract_test: {jsonpath_mini: "result.db_head_block", test: "exists"} + - extract_test: {jsonpath_mini: "result.db_head_time", test: "exists"} + - extract_test: {jsonpath_mini: "result.db_head_age", test: "exists"} - compare: {jsonpath_mini: "id", comparator: "str_eq", expected: {template: $test_id}} - - json_file_validator: {jsonpath_mini: "result", comparator: "json_compare", expected: {template: '$api/$method'}} - test: - name: "db_head_state" - variable_binds: - method: "db_head_state" - args: {} - - <<: *base_test \ No newline at end of file + - <<: *base_test diff --git a/tests/pyrest_tests/run_api_tests.sh b/tests/pyrest_tests/run_api_tests.sh index bbf42080c..0dd08ad6b 100644 --- a/tests/pyrest_tests/run_api_tests.sh +++ b/tests/pyrest_tests/run_api_tests.sh @@ -16,7 +16,7 @@ else fi echo COMPARATOR: $COMPARATOR - +echo "Running API tests\n" pyresttest $NODE:$RPC_PORT ./basic_smoketest.yaml [ $? -ne 0 ] && echo FATAL: hivemind not running? && exit -1 @@ -37,5 +37,26 @@ pyresttest $NODE:$RPC_PORT ./hive_api/hive_api_test.yaml --import_extensions='va pyresttest $NODE:$RPC_PORT ./tags_api/tags_api_test.yaml --import_extensions='validator_ex;'$COMPARATOR [ $? -ne 0 ] && EXIT_CODE=-1 +echo "Done!\n" + +echo "Running API benchmark tests\n" +pyresttest $NODE:$RPC_PORT ./bridge_api/bridge_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 + +pyresttest $NODE:$RPC_PORT ./condenser_api/condenser_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 + +pyresttest $NODE:$RPC_PORT ./database_api/database_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 + +pyresttest $NODE:$RPC_PORT ./follow_api/follow_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 + +pyresttest $NODE:$RPC_PORT ./hive_api/hive_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 + +pyresttest $NODE:$RPC_PORT ./tags_api/tags_api_benchmark.yaml --import_extensions='validator_ex;'$COMPARATOR +[ $? -ne 0 ] && EXIT_CODE=-1 +echo "Done!\n" exit $EXIT_CODE diff --git a/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml b/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml new file mode 100644 index 000000000..9d9bbb916 --- /dev/null +++ b/tests/pyrest_tests/tags_api/tags_api_benchmark.yaml @@ -0,0 +1,23 @@ +--- + - config: + - testset: "Hive API Benchmark Tests" + - api: &api "hive" + - variable_binds: + - api: *api + - generators: + - test_id: {type: 'number_sequence', start: 1} + + - base_benchmark: &base_benchmark + - url: "/" + - group: *api + - method: "POST" + - generator_binds: + - test_id: test_id + - body: {template: {file: "./templates/request_template.json"}} + - warmup_runs: 0 + - benchmark_runs: '1000' + - output_format: csv + - metrics: + - total_time + - total_time: mean + - total_time: median \ 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 b30c99d38..48871eaf8 100644 --- a/tests/pyrest_tests/tags_api/tags_api_test.yaml +++ b/tests/pyrest_tests/tags_api/tags_api_test.yaml @@ -11,7 +11,7 @@ - generator_binds: - test_id: test_id - group: *api - - url: "/rpc" + - url: "/" - method: "POST" - body: {template: {file: "../templates/request_template.json"}} - validators: -- GitLab