Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Merge requests
!1296
Resolve
TMSS-2829
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve
TMSS-2829
TMSS-2829
into
master
Overview
0
Commits
15
Pipelines
0
Changes
3
Merged
Jorrit Schaap
requested to merge
TMSS-2829
into
master
1 year ago
Overview
0
Commits
15
Pipelines
0
Changes
3
Expand
Closes
TMSS-2829
0
0
Merge request reports
Viewing commit
3c677a15
Prev
Next
Show latest version
3 files
+
13
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
3c677a15
TMSS-2829
: fixed tests
· 3c677a15
Jorrit Schaap
authored
1 year ago
SAS/TMSS/backend/services/copy_service/t_copy_service.py
+
11
−
1
Options
@@ -20,6 +20,7 @@
import
unittest
import
uuid
import
os
from
unittest
import
mock
import
logging
logger
=
logging
.
getLogger
(
'
lofar.
'
+
__name__
)
@@ -63,8 +64,17 @@ class TestCopyService(unittest.TestCase):
cls
.
tmss_test_env
.
stop
()
cls
.
tmp_exchange
.
close
()
def
setUp
(
self
):
def
mocked_wrap_command_in_cep4_head_node_ssh_call
(
cmd
,
*
args
,
**
kwargs
):
logger
.
info
(
'
mocked_wrap_command_in_cep4_head_node_ssh_call returning original command (without ssh): %s
'
,
'
'
.
join
(
cmd
))
return
cmd
def
test_copy
(
self
):
wrap_command_in_cep4_head_node_ssh_call_patcher
=
mock
.
patch
(
'
lofar.sas.tmss.services.copy_service.wrap_command_in_cep4_available_node_with_lowest_load_ssh_call
'
)
self
.
addCleanup
(
wrap_command_in_cep4_head_node_ssh_call_patcher
.
stop
)
self
.
wrap_command_in_cep4_head_node_ssh_call_mock
=
wrap_command_in_cep4_head_node_ssh_call_patcher
.
start
()
self
.
wrap_command_in_cep4_head_node_ssh_call_mock
.
side_effect
=
mocked_wrap_command_in_cep4_head_node_ssh_call
def
test_copy_managed_and_unmanaged
(
self
):
from
lofar.sas.tmss.tmss.tmssapp.models
import
SchedulingUnitObservingStrategyTemplate
,
SchedulingSet
,
SubtaskType
from
lofar.sas.tmss.tmss.tmssapp.tasks
import
create_scheduling_unit_draft_from_observing_strategy_template
,
create_scheduling_unit_blueprint_and_tasks_and_subtasks_from_scheduling_unit_draft
,
create_cleanuptask_for_scheduling_unit_blueprint
from
lofar.sas.tmss.tmss.tmssapp.subtasks
import
schedule_subtask
,
wait_for_subtask_status
Loading