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

A bad order of SQL views fixed + submodule fix

parent b61d06b5
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!339Further simplifications regarding `get_pids*` methods
DROP VIEW IF EXISTS hive_accounts_info_view_lite;
CREATE OR REPLACE VIEW public.hive_accounts_info_view_lite
AS
SELECT ha.id,
ha.name,
COALESCE(posts.post_count, 0::bigint) AS post_count,
ha.created_at,
ha.reputation,
ha.rank,
ha.following,
ha.followers,
ha.lastread_at,
ha.posting_json_metadata,
ha.json_metadata
FROM hive_accounts ha
LEFT JOIN LATERAL
(
SELECT COUNT(1) AS post_count
FROM hive_posts hp
WHERE hp.counter_deleted = 0 and hp.author_id = ha.id
) posts ON true
;
DROP VIEW IF EXISTS hive_accounts_info_view; DROP VIEW IF EXISTS hive_accounts_info_view;
CREATE OR REPLACE VIEW public.hive_accounts_info_view CREATE OR REPLACE VIEW public.hive_accounts_info_view
AS AS
...@@ -46,26 +70,3 @@ CREATE OR REPLACE VIEW public.hive_accounts_info_view ...@@ -46,26 +70,3 @@ CREATE OR REPLACE VIEW public.hive_accounts_info_view
LIMIT 1 LIMIT 1
) whole_votes ON true ) whole_votes ON true
; ;
DROP VIEW IF EXISTS hive_accounts_info_view_lite;
CREATE OR REPLACE VIEW public.hive_accounts_info_view_lite
AS
SELECT ha.id,
ha.name,
COALESCE(posts.post_count, 0::bigint) AS post_count,
ha.created_at,
ha.reputation,
ha.rank,
ha.following,
ha.followers,
ha.lastread_at,
ha.posting_json_metadata,
ha.json_metadata
FROM hive_accounts ha
LEFT JOIN LATERAL
(
SELECT COUNT(1) AS post_count
FROM hive_posts hp
WHERE hp.counter_deleted = 0 and hp.author_id = ha.id
) posts ON true
;
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite errors="0" failures="1" hostname="dev7" name="pytest" skipped="0" tests="1" time="0.620" timestamp="2020-11-02T14:41:30.207316"><testcase classname="condenser_api_patterns.get_state.gtg_permlink.tavern.yaml" name="Hivemind condenser_api.get_state patterns test" time="0.524"><failure message="Format variables:&#10; service.proto:s = 'http'&#10; service.server:s = '127.0.0.1'&#10; service.port = '6666'&#10;&#10;Source test stage (line 10):&#10; - name: get_state&#10; request:&#10; url: &quot;{service.proto:s}://{service.server:s}:{service.port}/&quot;&#10; method: POST&#10; headers:&#10; content-type: application/json&#10; json:&#10; jsonrpc: &quot;2.0&quot;&#10; id: 1&#10; method: &quot;condenser_api.get_state&quot;&#10; params: [&quot;/category/@gtg/witness-gtg&quot;]&#10; response:&#10; status_code: 200&#10; verify_response_with:&#10; function: validate_response:compare_response_with_pattern&#10; extra_kwargs:&#10; method: &quot;gtg_permlink&quot;&#10;&#10;Formatted stage:&#10; name: get_state&#10; request:&#10; headers:&#10; content-type: application/json&#10; json:&#10; id: 1&#10; jsonrpc: '2.0'&#10; method: condenser_api.get_state&#10; params:&#10; - /category/@gtg/witness-gtg&#10; method: POST&#10; url: 'http://127.0.0.1:6666/'&#10; response:&#10; status_code: 200&#10; verify_response_with:&#10; extra_kwargs:&#10; directory: condenser_api_patterns/get_state&#10; method: gtg_permlink&#10; function: validate_response:compare_response_with_pattern&#10;&#10;Errors:&#10;E tavern.util.exceptions.TestFailError: Test 'get_state' failed:&#10; - Error calling validate function '&lt;function compare_response_with_pattern at 0x7fb40ec70598&gt;':&#10; Traceback (most recent call last):&#10; File &quot;/home/dev/.local/lib/python3.6/site-packages/tavern/response/base.py&quot;, line 141, in _maybe_run_validate_functions&#10; vf(response)&#10; File &quot;/home/dev/.local/lib/python3.6/site-packages/tavern/schemas/extensions.py&quot;, line 123, in inner&#10; return func(response, *args, **kwargs)&#10; File &quot;/home/dev/src/09.HIVE-HIVEMIND/hivemind/tests/tests_api/hivemind/tavern/validate_response.py&quot;, line 74, in compare_response_with_pattern&#10; raise PatternDiffException(msg)&#10; validate_response.PatternDiffException: Differences detected between response and pattern.">Format variables:
service.proto:s = 'http'
service.server:s = '127.0.0.1'
service.port = '6666'
Source test stage (line 10):
- 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: ["/category/@gtg/witness-gtg"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "gtg_permlink"
Formatted stage:
name: get_state
request:
headers:
content-type: application/json
json:
id: 1
jsonrpc: '2.0'
method: condenser_api.get_state
params:
- /category/@gtg/witness-gtg
method: POST
url: 'http://127.0.0.1:6666/'
response:
status_code: 200
verify_response_with:
extra_kwargs:
directory: condenser_api_patterns/get_state
method: gtg_permlink
function: validate_response:compare_response_with_pattern
Errors:
E tavern.util.exceptions.TestFailError: Test 'get_state' failed:
- Error calling validate function '&lt;function compare_response_with_pattern at 0x7fb40ec70598&gt;':
Traceback (most recent call last):
File "/home/dev/.local/lib/python3.6/site-packages/tavern/response/base.py", line 141, in _maybe_run_validate_functions
vf(response)
File "/home/dev/.local/lib/python3.6/site-packages/tavern/schemas/extensions.py", line 123, in inner
return func(response, *args, **kwargs)
File "/home/dev/src/09.HIVE-HIVEMIND/hivemind/tests/tests_api/hivemind/tavern/validate_response.py", line 74, in compare_response_with_pattern
raise PatternDiffException(msg)
validate_response.PatternDiffException: Differences detected between response and pattern.</failure></testcase></testsuite></testsuites>
\ No newline at end of file
Subproject commit 1ff7e46a13168eebcaabf8e47c01bcfda142832f Subproject commit 063bcd4a4afb6dce306f7f4734a85d7d64487c36
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