Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
6a594683
Commit
6a594683
authored
Aug 01, 2019
by
Markus Scheidgen
Browse files
More debug logs for search API.
parent
33976c01
Pipeline
#53030
failed with stages
in 15 minutes and 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/api/repo.py
View file @
6a594683
...
...
@@ -24,7 +24,7 @@ from elasticsearch_dsl import Q
from
elasticsearch.exceptions
import
NotFoundError
import
datetime
from
nomad
import
search
from
nomad
import
search
,
utils
from
.app
import
api
,
rfc3339DateTime
from
.auth
import
login_if_available
...
...
@@ -32,6 +32,8 @@ from .common import pagination_model, pagination_request_parser, calc_route
ns
=
api
.
namespace
(
'repo'
,
description
=
'Access repository metadata.'
)
logger
=
utils
.
get_logger
(
__name__
)
@
calc_route
(
ns
)
class
RepoCalcResource
(
Resource
):
...
...
@@ -252,6 +254,7 @@ class RepoCalcsResource(Resource):
q
=
q
&
without_currupted_mainfile
if
q
is
not
None
else
without_currupted_mainfile
search_parameters
=
create_search_parameters
()
logger
.
debug
(
'repo search'
,
search_parameters
=
str
(
search_parameters
))
try
:
if
scroll
:
...
...
nomad/search.py
View file @
6a594683
...
...
@@ -286,7 +286,7 @@ def _execute_paginated_search(
logger
.
debug
(
'search request'
,
search_request
=
str
(
paginated_search
.
to_dict
()))
response
=
paginated_search
.
execute
()
# pylint: disable=E1101
logger
.
debug
(
'search response'
,
search_request
=
str
(
paginated_search
.
to_dict
()))
logger
.
debug
(
'search response'
,
search_request
=
str
(
response
.
to_dict
()))
total_results
=
response
.
hits
.
total
search_results
=
[
hit
.
to_dict
()
for
hit
in
response
.
hits
]
...
...
tests/test_api.py
View file @
6a594683
...
...
@@ -26,7 +26,7 @@ import os.path
from
urllib.parse
import
urlencode
from
nomad.api.app
import
rfc3339DateTime
from
nomad
import
coe_repo
,
search
,
parsing
,
files
,
config
from
nomad
import
coe_repo
,
search
,
parsing
,
files
,
config
,
utils
from
nomad.files
import
UploadFiles
,
PublicUploadFiles
from
nomad.processing
import
Upload
,
Calc
,
SUCCESS
from
nomad.datamodel
import
UploadWithMetadata
,
CalcWithMetadata
...
...
@@ -38,6 +38,8 @@ from tests.test_coe_repo import assert_coe_upload
from
tests.test_search
import
assert_search_upload
logger
=
utils
.
get_logger
(
__name__
)
def
test_alive
(
client
):
rv
=
client
.
get
(
'/alive'
)
assert
rv
.
status_code
==
200
...
...
@@ -767,6 +769,7 @@ class TestRepo():
query_string
=
urlencode
({
quantity
:
value
},
doseq
=
True
)
rv
=
client
.
get
(
'/repo/?%s'
%
query_string
,
headers
=
test_user_auth
)
logger
.
debug
(
'run search quantities test'
,
query_string
=
query_string
)
data
=
self
.
assert_search
(
rv
,
calcs
)
quantities
=
data
.
get
(
'quantities'
,
None
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment