fix(integration): clear caplog before diffs and handle non-recurrence downtime dates - #730
Merged
Merged
Conversation
…-recurrence downtime dates Two fixes for integration test failures: 1. Clear caplog between import and diffs phases in test_resource_import and test_resource_import_per_file. Import-phase skip messages (e.g. 'Downtime is canceled') were leaking into the diffs caplog assertion, causing false failures when the diffs command itself produced no skip-related output. 2. Extend RECURRENCE_START_ATTR_PATH_RE to also match schedule.start (not just schedule.recurrences[N].start). Downtimes created without recurrences use schedule.start directly, and the date operator was not normalizing timezone format differences (+00:00 vs Z) for these, causing false diffs after update+sync.
michael-richey
force-pushed
the
fix-integration-test-caplog
branch
from
September 30, 2026 15:30
cb22022 to
1cadef5
Compare
michael-richey
marked this pull request as ready for review
September 30, 2026 15:43
heyronhay
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes for integration test failures that were causing 24 tests to fail:
1. Clear caplog between import and diffs phases
In
test_resource_importandtest_resource_import_per_file, import-phase skip messages (e.g.Downtime is canceled) were leaking into the diffs caplog assertion. The diffs command countsskipping resourcemessages in caplog to verify resource counts, but those messages came from the import phase, not the diffs phase. Addingcaplog.clear()before the diffs command isolates the assertion to only diffs-phase output.2. Handle non-recurrence downtime schedule dates
RECURRENCE_START_ATTR_PATH_REonly matchedschedule.recurrences[N].start, missingschedule.startdirectly (used by downtimes created without recurrences). TheDowntimeSchedulesDateOperatorwas not normalizing timezone format differences (+00:00vsZ) for these, causing false diffs after update+sync. The regex now matches both paths.Test results
Test plan