Skip to content
GitLab
Explore
Sign in
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
Commits
d102b75d
Commit
d102b75d
authored
4 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-726
: Fix _get_lta_dataproducts query; fix subtask creation in test
parent
5c741baf
No related branches found
No related tags found
1 merge request
!413
TMSS-726: Fix _get_lta_dataproducts query; fix subtask creation in test
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+2
-2
2 additions, 2 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
SAS/TMSS/backend/test/t_adapter.py
+2
-1
2 additions, 1 deletion
SAS/TMSS/backend/test/t_adapter.py
with
4 additions
and
3 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+
2
−
2
View file @
d102b75d
...
@@ -57,14 +57,14 @@ def _get_subs_and_durations_from_project(project_pk: int) -> {}:
...
@@ -57,14 +57,14 @@ def _get_subs_and_durations_from_project(project_pk: int) -> {}:
return
durations
return
durations
def
_get_lta_dataproducts
(
project_name
:
str
)
->
int
:
def
_get_lta_dataproducts
(
project_name
:
str
)
->
{}
:
"""
"""
Help function to retrieve the sum of the LTA dataproducts sizes.
Help function to retrieve the sum of the LTA dataproducts sizes.
"""
"""
# Query dataproducts from Subtasks of type 'ingest' within 'finished' status
# Query dataproducts from Subtasks of type 'ingest' within 'finished' status
return
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask__specifications_template__type
=
'
ingest
'
)
\
return
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask__specifications_template__type
=
'
ingest
'
)
\
.
filter
(
producer__subtask__state__value
=
'
finished
'
)
\
.
filter
(
producer__subtask__state__value
=
'
finished
'
)
\
.
filter
(
producer__subtask__task_blueprint__draft__scheduling_unit_draft__scheduling_set__project__name
=
project_name
)
\
.
filter
(
producer__subtask__task_blueprint
s
__draft__scheduling_unit_draft__scheduling_set__project__name
=
project_name
)
\
.
aggregate
(
Sum
(
'
size
'
))
.
aggregate
(
Sum
(
'
size
'
))
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/backend/test/t_adapter.py
+
2
−
1
View file @
d102b75d
...
@@ -533,7 +533,8 @@ class ProjectReportTest(unittest.TestCase):
...
@@ -533,7 +533,8 @@ class ProjectReportTest(unittest.TestCase):
tb
=
models
.
TaskBlueprint
.
objects
.
create
(
**
TaskBlueprint_test_data
(
task_draft
=
self
.
task_draft
,
scheduling_unit_blueprint
=
sub
))
tb
=
models
.
TaskBlueprint
.
objects
.
create
(
**
TaskBlueprint_test_data
(
task_draft
=
self
.
task_draft
,
scheduling_unit_blueprint
=
sub
))
# Create Subtask of type 'ingest'
# Create Subtask of type 'ingest'
subtask_template
=
models
.
SubtaskTemplate
.
objects
.
create
(
**
SubtaskTemplate_test_data
(
subtask_type_value
=
'
ingest
'
))
subtask_template
=
models
.
SubtaskTemplate
.
objects
.
create
(
**
SubtaskTemplate_test_data
(
subtask_type_value
=
'
ingest
'
))
subtask
=
models
.
Subtask
.
objects
.
create
(
**
Subtask_test_data
(
task_blueprint
=
tb
,
subtask_template
=
subtask_template
))
subtask
=
models
.
Subtask
.
objects
.
create
(
**
Subtask_test_data
(
subtask_template
=
subtask_template
))
subtask
.
task_blueprints
.
set
([
tb
])
if
status
:
# Set Subtask status to 'cancelled'
if
status
:
# Set Subtask status to 'cancelled'
with
tmss_test_env
.
create_tmss_client
()
as
client
:
with
tmss_test_env
.
create_tmss_client
()
as
client
:
...
...
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