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
a23a31dd
Commit
a23a31dd
authored
Mar 26, 2019
by
Markus Scheidgen
Browse files
Relaxed test timeouts.
parent
2a3a9260
Pipeline
#45890
failed with stages
in 46 minutes and 33 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/config.py
View file @
a23a31dd
...
...
@@ -111,6 +111,10 @@ services = NomadConfig(
not_processed_value
=
'not processed'
)
tests
=
NomadConfig
(
default_timeout
=
30
)
def
upload_url
():
return
'http://%s:%s/%s/uploads'
%
(
services
.
api_host
,
services
.
api_port
,
services
.
api_base_path
[:
-
3
])
...
...
tests/conftest.py
View file @
a23a31dd
...
...
@@ -530,7 +530,7 @@ def non_empty_uploaded(non_empty_example_upload: str, raw_files) -> Tuple[str, s
return
example_upload_id
,
non_empty_example_upload
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
@
pytest
.
fixture
(
scope
=
'function'
)
def
processed
(
uploaded
:
Tuple
[
str
,
str
],
test_user
:
coe_repo
.
User
,
proc_infra
)
->
processing
.
Upload
:
"""
...
...
@@ -539,7 +539,7 @@ def processed(uploaded: Tuple[str, str], test_user: coe_repo.User, proc_infra) -
return
test_processing
.
run_processing
(
uploaded
,
test_user
)
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
@
pytest
.
fixture
(
scope
=
'function'
)
def
non_empty_processed
(
non_empty_uploaded
:
Tuple
[
str
,
str
],
test_user
:
coe_repo
.
User
,
proc_infra
)
->
processing
.
Upload
:
"""
...
...
tests/processing/test_data.py
View file @
a23a31dd
...
...
@@ -19,7 +19,7 @@ import os.path
import
json
import
re
from
nomad
import
utils
,
infrastructure
from
nomad
import
utils
,
infrastructure
,
config
from
nomad.files
import
UploadFiles
,
StagingUploadFiles
,
PublicUploadFiles
from
nomad.processing
import
Upload
,
Calc
from
nomad.processing.base
import
task
as
task_decorator
,
FAILURE
,
SUCCESS
...
...
@@ -150,7 +150,7 @@ def test_publish_failed(
assert_search_upload
(
upload
,
additional_keys
,
published
=
True
,
processed
=
False
)
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_processing_with_warning
(
proc_infra
,
test_user
,
with_warn
):
example_file
=
'tests/data/proc/examples_with_warning_template.zip'
example_upload_id
=
os
.
path
.
basename
(
example_file
).
replace
(
'.zip'
,
''
)
...
...
@@ -159,7 +159,7 @@ def test_processing_with_warning(proc_infra, test_user, with_warn):
assert_processing
(
upload
)
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_process_non_existing
(
proc_infra
,
test_user
,
with_error
):
upload
=
run_processing
((
'__does_not_exist'
,
'__does_not_exist'
),
test_user
)
...
...
@@ -180,7 +180,7 @@ def mock_failure(cls, task, monkeypatch):
@
pytest
.
mark
.
parametrize
(
'task'
,
[
'extracting'
,
'parse_all'
,
'cleanup'
,
'parsing'
])
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_task_failure
(
monkeypatch
,
uploaded
,
task
,
proc_infra
,
test_user
,
with_error
):
# mock the task method to through exceptions
if
hasattr
(
Upload
,
task
):
...
...
tests/test_api.py
View file @
a23a31dd
...
...
@@ -22,7 +22,7 @@ import inspect
from
passlib.hash
import
bcrypt
from
datetime
import
datetime
from
nomad
import
coe_repo
,
search
,
parsing
,
files
from
nomad
import
coe_repo
,
search
,
parsing
,
files
,
config
from
nomad.files
import
UploadFiles
,
PublicUploadFiles
from
nomad.processing
import
Upload
,
Calc
,
SUCCESS
from
nomad.datamodel
import
UploadWithMetadata
,
CalcWithMetadata
...
...
@@ -56,13 +56,13 @@ def get_upload_with_metadata(upload: dict) -> UploadWithMetadata:
class
TestAdmin
:
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_reset
(
self
,
client
,
admin_user_auth
,
expandable_postgres
,
monkeypatch
):
monkeypatch
.
setattr
(
'nomad.config.services.disable_reset'
,
False
)
rv
=
client
.
post
(
'/admin/reset'
,
headers
=
admin_user_auth
)
assert
rv
.
status_code
==
200
@
pytest
.
mark
.
timeout
(
10
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_remove
(
self
,
client
,
admin_user_auth
,
expandable_postgres
,
monkeypatch
):
monkeypatch
.
setattr
(
'nomad.config.services.disable_reset'
,
False
)
rv
=
client
.
post
(
'/admin/remove'
,
headers
=
admin_user_auth
)
...
...
tests/test_migration.py
View file @
a23a31dd
...
...
@@ -21,7 +21,7 @@ import glob
import
bravado.exception
import
zipfile
from
nomad
import
infrastructure
,
coe_repo
,
utils
,
files
,
processing
from
nomad
import
infrastructure
,
coe_repo
,
utils
,
files
,
processing
,
config
from
nomad.migration
import
NomadCOEMigration
,
SourceCalc
,
Package
from
nomad.infrastructure
import
repository_db_connection
...
...
@@ -221,7 +221,7 @@ mirgation_test_specs = [
@
pytest
.
mark
.
filterwarnings
(
"ignore:SAWarning"
)
@
pytest
.
mark
.
parametrize
(
'name, test_directory, assertions'
,
mirgation_test_specs
)
@
pytest
.
mark
.
timeout
(
30
)
@
pytest
.
mark
.
timeout
(
config
.
tests
.
default_timeout
)
def
test_migrate
(
migrate_infra
,
name
,
test_directory
,
assertions
,
monkeypatch
,
caplog
):
perform_migration_test
(
migrate_infra
,
name
,
test_directory
,
assertions
,
monkeypatch
,
caplog
)
...
...
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