Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4422

Move flaky Prometheus metering test from integration suite to component level

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • swatch-metrics
    • None
    • False
    • Hide

      None

      Show
      None
    • 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

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: