diff --git a/datadog_sync/utils/resource_utils.py b/datadog_sync/utils/resource_utils.py index 0feae336..0ce84b18 100644 --- a/datadog_sync/utils/resource_utils.py +++ b/datadog_sync/utils/resource_utils.py @@ -148,7 +148,7 @@ def give_up_diffing(self, level, diff_instance) -> bool: return False -RECURRENCE_START_ATTR_PATH_RE = r"root\['attributes'\]\['schedule'\]\['recurrences'\]\[[0-9]+\]\['start'\]" +RECURRENCE_START_ATTR_PATH_RE = r"root\['attributes'\]\['schedule'\](?:\['recurrences'\]\[[0-9]+\])?\['start'\]" class DowntimeSchedulesDateOperator(BaseOperator): diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 918615e1..cc92946f 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -133,6 +133,10 @@ def test_resource_import(self, runner, caplog): source_resources, _ = open_resources(self.resource_type) assert len(source_resources) > 0 + # Clear caplog so import-phase skip messages don't leak into the diffs + # assertion below (e.g. canceled downtimes skipped during import). + caplog.clear() + # Disable skipping on resource connection failure # From stdout, count the number of resources to be added and ensure they match the import len() diff_cmd = [ @@ -414,6 +418,10 @@ def test_resource_import_per_file(self, runner, caplog): ":", "." ), f"Resource with ID {resource_id} should have a file with {file_id}" + # Clear caplog so import-phase skip messages don't leak into the diffs + # assertion below (e.g. canceled downtimes skipped during import). + caplog.clear() + # Run diffs to ensure everything is recognized properly ret = runner.invoke( cli,