Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
8bf02600
Commit
8bf02600
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
A bad order of SQL views fixed + submodule fix
parent
b61d06b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!456
Release candidate v1 24
,
!339
Further simplifications regarding `get_pids*` methods
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hive/db/sql_scripts/hive_accounts_info_view.sql
+24
-23
24 additions, 23 deletions
hive/db/sql_scripts/hive_accounts_info_view.sql
test-log.txt
+56
-0
56 additions, 0 deletions
test-log.txt
tests/tests_api
+1
-1
1 addition, 1 deletion
tests/tests_api
with
81 additions
and
24 deletions
hive/db/sql_scripts/hive_accounts_info_view.sql
+
24
−
23
View file @
8bf02600
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
;
This diff is collapsed.
Click to expand it.
test-log.txt
0 → 100644
+
56
−
0
View file @
8bf02600
<?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: 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 '<function compare_response_with_pattern at 0x7fb40ec70598>': 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.">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 '<function compare_response_with_pattern at 0x7fb40ec70598>':
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
This diff is collapsed.
Click to expand it.
tests_api
@
063bcd4a
Compare
1ff7e46a
...
063bcd4a
Subproject commit
1ff7e46a13168eebcaabf8e47c01bcfda142832f
Subproject commit
063bcd4a4afb6dce306f7f4734a85d7d64487c36
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment