Skip to content

LO-101: Add integration tests for campaign steps execution#466

Open
GAYATHRI-R217 wants to merge 1 commit into
Kuldeeep18:mainfrom
GAYATHRI-R217:test-campaign-sequence
Open

LO-101: Add integration tests for campaign steps execution#466
GAYATHRI-R217 wants to merge 1 commit into
Kuldeeep18:mainfrom
GAYATHRI-R217:test-campaign-sequence

Conversation

@GAYATHRI-R217

@GAYATHRI-R217 GAYATHRI-R217 commented Jun 28, 2026

Copy link
Copy Markdown

Pull Request

🔗 Related Issue

Closes #447


📝 Summary of Changes

This PR adds integration test coverage for the campaign sequence execution workflow.

The new test verifies that a lead progresses through a multi-step campaign sequence (Email → Wait → LinkedIn) as the scheduler runs over time. Time progression is simulated using freezegun to ensure the test remains deterministic and reliable.

Changes Made

  • Added an integration test for campaign sequence progression.
  • Verified that the scheduler processes the Email step correctly.
  • Simulated time progression for the Wait step using freezegun.
  • Verified that the lead advances to the LinkedIn step after the wait period.
  • Confirmed that the campaign is marked as finished after the final step completes.
  • Added freezegun as a dependency required for the new integration test.

🏷️ Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation update
  • 🎨 UI / Style change
  • 🔧 Chore

🧪 Testing

The changes were tested locally.

Steps to test:

  1. Install project dependencies using pip install -r requirements.txt.
  2. Run python manage.py test campaigns.tests.
  3. Run python manage.py test.
  4. Confirm that the new integration test and the existing test suite pass successfully.

📸 Screenshots (if applicable)

Not applicable.


✅ Checklist

  • No merge conflicts
  • Changes follow the project guidelines
  • Documentation updated (not applicable)
  • Related issue linked
  • Changes tested locally

Summary by CodeRabbit

  • Tests
    • Added coverage for a multi-step campaign flow, including timed waiting and progression through email and LinkedIn steps until completion.
  • Chores
    • Added a testing dependency to support time-based test scenarios.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f63eb16-d81f-450b-ab07-9ec8e2fbfd0f

📥 Commits

Reviewing files that changed from the base of the PR and between 4a33158 and 29136d1.

📒 Files selected for processing (2)
  • backend/campaigns/tests.py
  • requirements.txt

📝 Walkthrough

Walkthrough

Adds freezegun>=1.5.5 to requirements.txt and introduces a new integration test in backend/campaigns/tests.py that creates a 3-step campaign sequence (EMAIL → WAIT → LINKEDIN), freezes time, ticks forward past step delays, and asserts correct lead step transitions and final FINISHED status.

Campaign Step Progression Test

Layer / File(s) Summary
freezegun dependency and multi-step sequence test
requirements.txt, backend/campaigns/tests.py
Adds freezegun>=1.5.5 as a dependency, imports freeze_time, and implements test_multi_step_sequence_progresses_through_email_wait_and_linkedin to assert email task enqueueing, step transitions through EMAIL/WAIT/LINKEDIN, and final FINISHED state with current_step cleared.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Tick-tock, the clock is frozen still,
A lead hops through steps with email thrill,
WAIT and LINKEDIN, one by one,
freeze_time makes sure the test is done,
FINISHED! The rabbit cheers—tests pass! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding integration tests for campaign step execution.
Linked Issues check ✅ Passed The new test covers the requested Email → Wait → LinkedIn progression with time freezing and confirms the sequence finishes.
Out of Scope Changes check ✅ Passed The only changes are the integration test and its test dependency, both directly aligned with the linked issue.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Kuldeeep18

Copy link
Copy Markdown
Owner

Hi @GAYATHRI-R217 👋

LeadOrbit Bot here 🤖

We noticed you've opened a Pull Request but haven't starred the repository yet.

Starring the repository is mandatory for PR review and merge.

Please:

  1. Star the repository.
  2. Reply to this comment with "Done".

Once you've done that, the bot will continue processing your PR.

Note: PRs from contributors who haven't starred the repository will remain pending until this requirement is completed.

Thanks for contributing to LeadOrbit! 🚀

@GAYATHRI-R217

Copy link
Copy Markdown
Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LO-101 [Intermediate]: Write Integration Tests for Campaign Steps Execution

2 participants