Add tests for celery tasks#77
Closed
gijzelaerr wants to merge 2 commits into
Closed
Conversation
…notify_expirations, clean_all_sources) These scheduled tasks are the core of Lemur's automation — they run certificate rotation, reissuance, expiry notifications, and source cleanup on a schedule. Previously had zero test coverage. Tests cover: - certificate_rotate: CLI dispatch, notification config, region routing, SoftTimeLimitExceeded handling, duplicate task guard, success metric - certificate_reissue: CLI dispatch, notification config, timeout handling, success metric - notify_expirations: CLI dispatch, config passthrough, timeout - clean_all_sources: per-source task dispatch, success metric
Member
Author
|
Superseded by new PR based on main |
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
Adds test coverage for the four celery tasks that drive Lemur's production automation — previously had zero tests.
certificate_rotate(6 tests)cli_certificate.rotatewith correct argsENABLE_ROTATION_NOTIFICATIONconfigrotate_regionwhenregionkwarg is givenSoftTimeLimitExceeded(logs + timeout metric, no crash)certificate_reissue(4 tests)cli_certificate.reissueENABLE_REISSUE_NOTIFICATIONconfigSoftTimeLimitExceedednotify_expirations(3 tests)cli_notification.expirationsEXCLUDE_CN_FROM_NOTIFICATIONandDISABLE_NOTIFICATION_PLUGINSconfigSoftTimeLimitExceededclean_all_sources(2 tests)clean_source.delay()per sourceContext
These tasks run on a celery beat schedule and are the backbone of automated cert lifecycle management. The
certificate_rotatetask is what triggered the list-mutation bug (PR #71) in production — having tests at the task level ensures the orchestration layer is correct in addition to the CLI layer (PR #76).