Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM Workflow Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM Workflow Service
Merge requests
!30
Resolve "Workflow usage statistics"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Workflow usage statistics"
feature/24-workflow-usage-statistics
into
development
Overview
0
Commits
2
Pipelines
3
Changes
5
Merged
Daniel Göbel
requested to merge
feature/24-workflow-usage-statistics
into
development
2 years ago
Overview
0
Commits
2
Pipelines
3
Changes
2
Expand
Closes
#24 (closed)
0
0
Merge request reports
Compare
version 1
version 1
68b6beda
2 years ago
development (base)
and
latest version
latest version
c8b5d24e
2 commits,
2 years ago
version 1
68b6beda
1 commit,
2 years ago
Show latest version
2 files
+
51
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
app/tests/api/test_workflow.py
+
30
−
1
Options
from
datetime
import
date
from
io
import
BytesIO
from
uuid
import
UUID
,
uuid4
import
pytest
from
clowmdb.models
import
Workflow
,
WorkflowVersion
from
clowmdb.models
import
Workflow
,
WorkflowExecution
,
WorkflowVersion
from
fastapi
import
status
from
httpx
import
AsyncClient
from
sqlalchemy
import
delete
,
select
@@ -380,6 +381,34 @@ class TestWorkflowRoutesGet(_TestWorkflowRoutes):
)
assert
response
.
status_code
==
status
.
HTTP_404_NOT_FOUND
@pytest.mark.asyncio
async
def
test_get_workflow_statistics
(
self
,
client
:
AsyncClient
,
random_user
:
UserWithAuthHeader
,
random_workflow
:
WorkflowOut
,
random_workflow_execution
:
WorkflowExecution
,
)
->
None
:
"""
Test for getting a non-existing workflow.
Parameters
----------
client : httpx.AsyncClient
HTTP Client to perform the request on. pytest fixture.
random_user : app.tests.utils.user.UserWithAuthHeader
Random user for testing. pytest fixture.
"""
response
=
await
client
.
get
(
"
/
"
.
join
([
self
.
base_path
,
str
(
random_workflow
.
workflow_id
),
"
statistics
"
]),
headers
=
random_user
.
auth_headers
,
)
assert
response
.
status_code
==
status
.
HTTP_200_OK
statistics
=
response
.
json
()
assert
len
(
statistics
)
==
1
assert
statistics
[
0
][
"
day
"
]
==
str
(
date
.
today
())
assert
statistics
[
0
][
"
count
"
]
==
1
class
TestWorkflowRoutesDelete
(
_TestWorkflowRoutes
):
@pytest.mark.asyncio
Loading