Skip to content

fix(integration): clear caplog before diffs and handle non-recurrence downtime dates - #730

Merged
michael-richey merged 1 commit into
mainfrom
fix-integration-test-caplog
Sep 30, 2026
Merged

michael-richey merged 1 commit into
mainfrom
fix-integration-test-caplog

Conversation

@michael-richey

Copy link
Copy Markdown
Collaborator

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_import and test_resource_import_per_file, import-phase skip messages (e.g. Downtime is canceled) were leaking into the diffs caplog assertion. The diffs command counts skipping resource messages in caplog to verify resource counts, but those messages came from the import phase, not the diffs phase. Adding caplog.clear() before the diffs command isolates the assertion to only diffs-phase output.

2. Handle non-recurrence downtime schedule dates

RECURRENCE_START_ATTR_PATH_RE only matched schedule.recurrences[N].start, missing schedule.start directly (used by downtimes created without recurrences). The DowntimeSchedulesDateOperator was not normalizing timezone format differences (+00:00 vs Z) for these, causing false diffs after update+sync. The regex now matches both paths.

Test results

  • Before: 24 failed, 160 passed
  • After: 184 passed, 0 failed (152 skipped, 1 retried)

Test plan

  • Ran full integration test suite locally against live eu1/us5 test orgs
  • All 184 tests pass with 0 failures

…-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
michael-richey force-pushed the fix-integration-test-caplog branch from cb22022 to 1cadef5 Compare September 30, 2026 15:30
@michael-richey
michael-richey marked this pull request as ready for review September 30, 2026 15:43
@michael-richey
michael-richey requested a review from a team as a code owner September 30, 2026 15:43
@michael-richey
michael-richey merged commit 1cdd8a9 into main Sep 30, 2026
19 of 20 checks passed
@michael-richey
michael-richey deleted the fix-integration-test-caplog branch September 30, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants