diff --git a/components/shared_code/src/shared/model/measurement.py b/components/shared_code/src/shared/model/measurement.py index d20d3f1ab5..93eccb2b67 100644 --- a/components/shared_code/src/shared/model/measurement.py +++ b/components/shared_code/src/shared/model/measurement.py @@ -302,8 +302,6 @@ def summarize_latest(self) -> Self: if parameter_hash != self.metric.source_parameter_hash(): self["outdated"] = True del self["source_parameter_hash"] - if measurement_requested := self.metric.get("measurement_requested"): - self["measurement_requested"] = measurement_requested >= self["end"] return self def source_parameter_hash(self) -> str: diff --git a/components/shared_code/tests/shared/model/test_measurement.py b/components/shared_code/tests/shared/model/test_measurement.py index 7d47f43bf7..f4594d838c 100644 --- a/components/shared_code/tests/shared/model/test_measurement.py +++ b/components/shared_code/tests/shared/model/test_measurement.py @@ -485,29 +485,6 @@ def test_summarize_with_non_default_start_date(self): measurement.summarize(), ) - def test_summarize_latest_with_old_measurement_request(self): - """Test that the measurement includes the measurement requested flag when a measurement was requested.""" - now = datetime.now(tz=UTC).replace(microsecond=0) - just_now = (now - timedelta(seconds=1)).isoformat() - metric = self.metric(measurement_requested=just_now) - measurement = self.measurement(metric, start=now.isoformat(), end=now.isoformat()) - self.assertFalse(measurement.summarize_latest()["measurement_requested"]) - - def test_summarize_latest_with_new_measurement_request(self): - """Test that the measurement includes the measurement requested flag when a measurement was requested.""" - now = datetime.now(tz=UTC).replace(microsecond=0) - just_now = (now - timedelta(seconds=1)).isoformat() - metric = self.metric(measurement_requested=now.isoformat()) - measurement = self.measurement(metric, start=just_now, end=just_now) - self.assertTrue(measurement.summarize_latest()["measurement_requested"]) - - def test_summarize_latest_without_measurement_request(self): - """Test that the measurement has no measurement requested flag when no measurement was requested.""" - now = datetime.now(tz=UTC).replace(microsecond=0).isoformat() - metric = self.metric() - measurement = self.measurement(metric, start=now, end=now) - self.assertNotIn("measurement_requested", measurement.summarize_latest()) - class CalculateMeasurementValueTest(MeasurementTestCase): """Unit tests for calculating the measurement value from one or more source measurements.""" diff --git a/docs/src/changelog.md b/docs/src/changelog.md index bee933e976..cab9a4923a 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -17,7 +17,6 @@ If your currently installed *Quality-time* version is not v5.16.0, please first ### Fixed - Work around a [bug in aiohttp](https://github.com/aio-libs/aiohttp/issues/2217) that causes Dependency-Track connections to hang and timeout when the Dependency-Track data is paginated. Fixes [#9599](https://github.com/ICTU/quality-time/issues/9599). -- Show the hour glass icon when copying a metric with a source. Fixes [#9631](https://github.com/ICTU/quality-time/issues/9631). ## v5.16.0 - 2024-09-19 diff --git a/tests/feature_tests/src/features/metric.feature b/tests/feature_tests/src/features/metric.feature index 73b58bdd83..cc1dc0c8f8 100644 --- a/tests/feature_tests/src/features/metric.feature +++ b/tests/feature_tests/src/features/metric.feature @@ -138,14 +138,3 @@ Feature: metric Given an existing metric When the client changes the metric comment to "Text" Then the metric comment is "Text" - - Scenario: request measurement - Given an existing metric - And an existing source - And the collector has measured "100" - When the client requests the metric to be measured - Then the metric is being measured - When the client waits a second - And the collector measures "100" - And the client waits a second - Then the metric is not being measured diff --git a/tests/feature_tests/src/steps/metric.py b/tests/feature_tests/src/steps/metric.py index 026124fb63..506c026ec2 100644 --- a/tests/feature_tests/src/steps/metric.py +++ b/tests/feature_tests/src/steps/metric.py @@ -1,7 +1,5 @@ """Feature tests for metric specific attributes.""" -from datetime import UTC, datetime - from asserts import assert_equal, assert_false, assert_is_none, assert_is_not_none, assert_true from behave import then, when from behave.runner import Context @@ -65,21 +63,6 @@ def do_not_accept_technical_debt(context: Context) -> None: context.post(f"metric/{context.uuid['metric']}/debt", json={"accept_debt": False}) -@when("the client requests the metric to be measured") -def measurement_request(context: Context) -> None: - """Request a metric to be measured.""" - now = datetime.now(tz=UTC).replace(microsecond=0).isoformat() - attribute_endpoint = f"metric/{context.uuid['metric']}/attribute/measurement_requested" - context.post(attribute_endpoint, json={"measurement_requested": now}) - - -@then("the metric is {being} measured") -def assert_metric_is_being_measured(context: Context, being: str) -> None: - """Assert that the metric is 'being' measured' or is 'not being' measured.""" - metric = get_item(context, "metric") - assert_equal(bool(being == "being"), metric["latest_measurement"]["measurement_requested"]) - - @then("the metric technical debt end date is empty") def assert_metric_technical_debt_end_date_is_empty(context: Context) -> None: """Assert the metric technical debt end date is empty."""