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
e8f65ced
Commit
e8f65ced
authored
Aug 08, 2019
by
Markus Scheidgen
Browse files
Fixed failed test cases.
parent
cebf4c81
Changes
2
Hide whitespace changes
Inline
Side-by-side
nomad/cli/client/mirror.py
View file @
e8f65ced
...
...
@@ -113,10 +113,7 @@ def mirror(
try
:
upload
=
proc
.
Upload
.
get
(
upload_id
)
if
__in_test
:
proc
.
Calc
.
objects
(
upload_id
=
upload_id
).
delete
()
proc
.
Upload
.
objects
(
upload_id
=
upload_id
).
delete
()
search
.
delete_upload
(
upload_id
)
# In tests, we mirror from our selves, fake that the upload does not exist
raise
KeyError
()
if
len
(
query
)
>
0
:
...
...
@@ -129,6 +126,12 @@ def mirror(
upload_data
=
client
.
mirror
.
get_upload_mirror
(
upload_id
=
upload_id
).
response
().
result
n_calcs
=
len
(
upload_data
.
calcs
)
if
__in_test
:
# In tests, we mirror from our selves, remove it so it is not there for import
proc
.
Calc
.
objects
(
upload_id
=
upload_id
).
delete
()
proc
.
Upload
.
objects
(
upload_id
=
upload_id
).
delete
()
search
.
delete_upload
(
upload_id
)
else
:
n_calcs
=
0
...
...
nomad/coe_repo/user.py
View file @
e8f65ced
...
...
@@ -135,6 +135,11 @@ class User(Base): # type: ignore
# TODO this has to change, e.g. trade for JWTs
token
=
''
.
join
(
random
.
choices
(
User
.
_token_chars
,
k
=
64
))
session
=
Session
(
token
=
token
,
user
=
self
)
# This will allow to add session to repo_db, even though it is already
# attached to a different repo_db SQL alchemy session. This happens during
# migration tests, where we mimic the use of two different postgres
# databases
session
=
repo_db
.
merge
(
session
)
repo_db
.
add
(
session
)
repo_db
.
commit
()
...
...
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