Skip to content
Snippets Groups Projects
Commit c392913d authored by Mariusz Trela's avatar Mariusz Trela
Browse files

New tests in groups: `condenser_api_patterns/get_discussions_by_feed` +...

New tests in groups: `condenser_api_patterns/get_discussions_by_feed` + `condenser_api_patterns/get_state`
parent 2dce711b
No related branches found
No related tags found
3 merge requests!165Mt further pids refactoring old,!161Tests specific to hivemind MR https://gitlab.syncad.com/hive/hivemind/-/merge_requests/329,!156Further pids refactoring
Showing
with 69477 additions and 2 deletions
It's possible to check original values on 0.23 hivemind. It has to be done manually, due to the error when `last_month` is calculated.
Example:
params: {"tag":"blocktrades","start_author":"michelle.gent","start_permlink":"dusty-the-demon-hunter-part-4","limit":10}
------------
a) Find id of account:
select * from hive_accounts where name = 'blocktrades'
found: `441`
------------
b) Find post's id for given author and permlink
SELECT id FROM hive_posts WHERE author = 'michelle.gent' AND permlink = 'dusty-the-demon-hunter-part-4'
found: `711172`
------------
Following query is taken from 0.23 version( for 5 million blocks ).
c) Put calculated values instead of _ID_ACCOUNT, _POST_ID, _LIMIT.
-----------
select hpc.post_id, hpc.author, hpc.permlink
FROM hive_posts_cache hpc
JOIN
(
SELECT post_id
FROM hive_feed_cache
JOIN hive_follows ON account_id = hive_follows.following AND state = 1
JOIN hive_accounts ON hive_follows.following = hive_accounts.id
WHERE hive_follows.follower = _ID_ACCOUNT(here 441)
AND hive_feed_cache.created_at > ( '2016-09-15 19:47:15.0'::timestamp - interval '1 month' )
GROUP BY post_id
HAVING MIN(hive_feed_cache.created_at) <= (
SELECT MIN(created_at) FROM hive_feed_cache WHERE post_id = _POST_ID(here 711172)
AND account_id IN (SELECT following FROM hive_follows
WHERE follower = _ID_ACCOUNT(here 441) AND state = 1))
ORDER BY MIN(hive_feed_cache.created_at) DESC
) T ON hpc.post_id = T.post_id
ORDER BY post_id DESC
LIMIT _LIMIT(here 10)
------------
Check `readme.txt` first
post_id author permlink
------- --------------- ------------------------------------------------------------------------------------------------
707330 nonlinearone in-which-alex-and-ranger-play-fetch-in-the-pool
707012 georgedonnelly episodes-60-63-of-the-coup-conspiracy-dystopian-cryptocurrency-novel
707004 rea the-greatest-joys-can-come-in-the-smallest-packages
706989 asdes very-non-standard-solution-steve-jobs-has-such-people-appreciated
706848 mindover to-the-42-of-american-college-graduates-will-never-read-another-book-for-the-rest-of-their-lives
706706 hilarski 5-types-of-sales-people-and-their-dog-equivalent
706652 jpiper20 let-s-work-together-and-stop-bullies-super-sad-story
706627 someguy123 steam-game-giveaway-outlast
706586 dragonslayer109 a-day-in-the-life-of-charles-darwin-featuring-new-author-cristi
706290 biophil lost-content-digest-4-all-proceeds-go-to-featured-authors
This diff is collapsed.
---
test_name: Hivemind condenser_api.get_discussions_by_feed patterns test
marks:
- patterntest # tag is not a tag but account whose feed we are looking at (set of posts created/reblogged by those followed by selected account)
# there can be no nonempty results for not-up-to-date HM because it only gives posts that were created/reblogged within last month (no param to change it)
includes:
- !include ../../common.yaml
stages:
- name: get_discussions_by_feed
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_discussions_by_feed"
params: {"tag":"abit","start_author":"nonlinearone","start_permlink":"in-which-alex-and-ranger-play-fetch-in-the-pool","limit":10}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "abit"
directory: "condenser_api_patterns/get_discussions_by_feed"
\ No newline at end of file
Check `readme.txt` first
post_id author permlink
------- ------------- ----------------------------------------------------------------------------------------------------
711172 michelle.gent dusty-the-demon-hunter-part-4
711107 michelle.gent dusty-the-demon-hunter-part-3
711028 michelle.gent dusty-the-demon-hunter-part-2
710944 michelle.gent dusty-the-demon-hunter-a-short-story-in-a-few-parts-1
710453 markrmorrisjr short-story-honobia-on-a-usd10-000-00-budget-or-how-to-hunt-sasquatch-for-fun-and-college-credit-par
697179 markrmorrisjr short-story-a-goldfish-mastermind-named-benedict-cumberbatch-and-the-league-of-domesticated-assasins
688460 dantheman steem-dollars-have-limits
686297 markrmorrisjr a-goldfish-mastermind-named-benedict-cumberbatch-and-the-league-of-domesticated-assasins
686111 markrmorrisjr the-odyssey-or-how-my-quest-to-make-spd-usd-turned-into-a-nightmare
684485 dantheman steem-dollar-stability-enhancements
---
test_name: Hivemind condenser_api.get_discussions_by_feed patterns test
marks:
- patterntest # tag is not a tag but account whose feed we are looking at (set of posts created/reblogged by those followed by selected account)
# there can be no nonempty results for not-up-to-date HM because it only gives posts that were created/reblogged within last month (no param to change it)
includes:
- !include ../../common.yaml
stages:
- name: get_discussions_by_feed
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_discussions_by_feed"
params: {"tag":"blocktrades","start_author":"michelle.gent","start_permlink":"dusty-the-demon-hunter-part-4","limit":10}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "blocktrades"
directory: "condenser_api_patterns/get_discussions_by_feed"
\ No newline at end of file
Check `readme.txt` first
post_id author permlink
------- --------------- ----------------------------------------------------------------------------------------------------
640267 jl777 300-btc-open-market-purchase-of-steem-spikes-price-to-00324
640175 hisnameisolllie curation-bot-s-race-to-the-bottom-the-impending-bot-armageddon
639772 fyrstikken introducing-steemspeak-com-a-voice-community-and-24-7-radio-station-for-steemians
638995 knozaki2015 i-travel-the-world-part-19-din-tai-fung-taipei
638815 dana-edwards series-achieving-financial-independence-with-steem-intro-1
638580 crazymumzysa for-the-mint-of-peppermint-featuring-author-thegoldencookie
638374 mrosenquist to-upvote-or-not-on-comments-that-is-the-question
637730 thedashguy recreational-cannabis-or-say-hello-to-the-new-and-improved-www-rainiercannabis-com-built-by-thedashg
637202 sascha typography-part-2-remarkable-typographers-and-their-unparalleled-achievements
636529 originate the-steem-multiple-persona-conundrum-part-1
---
test_name: Hivemind condenser_api.get_discussions_by_feed patterns test
marks:
- patterntest # tag is not a tag but account whose feed we are looking at (set of posts created/reblogged by those followed by selected account)
# there can be no nonempty results for not-up-to-date HM because it only gives posts that were created/reblogged within last month (no param to change it)
includes:
- !include ../../common.yaml
stages:
- name: get_discussions_by_feed
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_discussions_by_feed"
params: {"tag":"good-karma","start_author":"jl777","start_permlink":"300-btc-open-market-purchase-of-steem-spikes-price-to-00324","limit":10}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "good-karma"
directory: "condenser_api_patterns/get_discussions_by_feed"
\ No newline at end of file
[]
Check `readme.txt` first
post_id author permlink
------- --------- -----------------------------------------------------
960842 betamusic the-history-of-danna-a-dog-abandoned-saved-by-steemit
[]
Check `readme.txt` first
post_id author permlink
------- --------- -----------------------------------------------------
960842 betamusic the-history-of-danna-a-dog-abandoned-saved-by-steemit
This diff is collapsed.
This diff is collapsed.
---
test_name: Hivemind condenser_api.get_state patterns test # Deprecated
marks:
- patterntest
includes:
- !include ../../common.yaml
stages:
- name: get_state
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_state"
params: ["/@blocktrades"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "blocktrades"
directory: "condenser_api_patterns/get_state"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment