File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed
tests/opentelemetry-test-utils/tests Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,17 @@ def test_sdk_resource_with_service_name(self):
5858 weaver .end_and_check ()
5959
6060 def test_custom_policy_violation_raises (self ):
61- """A policy that forbids service.name causes end_and_check to raise ."""
61+ """A policy that fails on never.use.this.attribute ."""
6262 with WeaverLiveCheck (policies_dir = _TESTDATA_DIR ) as weaver :
6363 provider = _make_provider (weaver .otlp_endpoint )
6464 with provider .get_tracer ("test-tracer" ).start_as_current_span (
6565 "test-span"
66- ):
67- pass
66+ ) as span :
67+ span .set_attribute ("never.use.this.attribute" , "bad value" )
68+
6869 provider .force_flush ()
6970
7071 with self .assertRaises (AssertionError ) as cm :
7172 weaver .end_and_check ()
7273
73- self .assertIn ("service.name " , str (cm .exception ))
74+ self .assertIn ("never.use.this.attribute " , str (cm .exception ))
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package live_check_advice
2+
3+ import rego.v1
4+
5+ deny contains result if {
6+ input .sample.attribute.name == " never.use.this.attribute"
7+ result := {
8+ " type" : " advice" ,
9+ " advice_type" : " test_check" ,
10+ " advice_level" : " violation" ,
11+ " message" : " never.use.this.attribute is forbidden by this bogus policy" ,
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments