Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stingray
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
LOFAR2.0
Stingray
Commits
b5513222
Commit
b5513222
authored
11 months ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
eb61ecca
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
Draft: Added prometheus metrics
Pipeline
#78585
failed
11 months ago
Stage: prepare
Stage: lint
Stage: test
Stage: package
Stage: images
Stage: integration
Pipeline: Stingray
#78586
This commit is part of merge request
!5
. Comments created here will be created in the context of that merge request.
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_writer.py
+10
-0
10 additions, 0 deletions
tests/test_writer.py
with
10 additions
and
0 deletions
tests/test_writer.py
+
10
−
0
Edit
View file @
b5513222
...
...
@@ -8,6 +8,8 @@ from unittest.mock import patch, ANY, create_autospec
from
minio
import
Minio
from
prometheus_client.registry
import
REGISTRY
from
lofar_stingray.writer
import
Block
,
Storage
...
...
@@ -17,6 +19,14 @@ class TestStorage(TestCase):
def
setUp
(
self
):
self
.
mock_minio
=
create_autospec
(
Minio
)
# Clear all metrics to make sure we don't register the same one twice
# between tests (the library forbids it).
#
# Unfortunately, Metrics draw copies of prometheus_client.registry.REGISTRY,
# and that does not provide a public interface to query the registered collectors.
for
collector
in
list
(
REGISTRY
.
_collector_to_names
.
keys
()):
REGISTRY
.
unregister
(
collector
)
def
test_create_bucket_if_not_exists
(
self
):
"""
Test if bucket is created if not exists
"""
self
.
mock_minio
.
bucket_exists
.
return_value
=
False
...
...
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