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
Merge requests
!5
Draft: Added prometheus metrics
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Added prometheus metrics
add-prometheus-metrics
into
main
Overview
0
Commits
7
Pipelines
7
Changes
1
Closed
Jan David Mol
requested to merge
add-prometheus-metrics
into
main
11 months ago
Overview
0
Commits
7
Pipelines
7
Changes
1
Expand
0
0
Merge request reports
Viewing commit
b5513222
Prev
Next
Show latest version
1 file
+
10
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b5513222
fix
· b5513222
Jan David Mol
authored
11 months ago
tests/test_writer.py
+
10
−
0
Options
@@ -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
Loading