-
Task
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
False
-
-
False
-
subs-swatch-thunder
-
-
We need to relocate the IQE test test_verify_metering_operation_for_events_received_from_prometheus_for_rhel_payg_products to became a component test to improve reliability and remove environment-specific dependencies.
Currently, we have an integration test (test_verify_metering_operation_for_events_received_from_prometheus_for_rhel_payg_products) that verifies the metering operation for RHEL PAYG products using mock Prometheus events. This test runs in the IQE suite but fails inconsistently due to environment-specific assertion logic.
The test expects the event_source field to be "rhelemeter" in non-local environments but receives "prometheus" instead. This happens because the test has hardcoded environment checks (ENV_FOR_DYNACONF == "local") that don't align with how the actual ephemeral test environment behaves. The assertion 'prometheus' == 'rhelemeter' fails, even though the metering operation itself completes successfully and generates the expected events.
This kind of environment-dependent assertion logic is fragile in integration tests. By moving this to a component test within the swatch-metrics service, we can eliminate these environment-specific checks, control the test data more precisely, and verify the metering logic without relying on external Prometheus mock infrastructure or environment configuration inconsistencies.
Acceptance Criteria
- Add the component test in swatch-metrics service
- Delete the IQE test