Skip to content

Conversation

emekanwaoma
Copy link
Contributor

@emekanwaoma emekanwaoma commented Oct 15, 2025

User description

Description

What -

Why -

How -

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Completed a full resync from a freshly installed integration and it completed successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.


PR Type

Tests


Description

  • Added mock_datetime fixture parameter to pull request test methods

  • Added comments to prevent modification of critical test datetime values

  • Ensured consistent datetime mocking across test cases


Diagram Walkthrough

flowchart LR
  A["Test Methods"] --> B["mock_datetime Fixture"]
  B --> C["Consistent DateTime Values"]
  C --> D["Reliable Test Results"]
Loading

File Walkthrough

Relevant files
Tests
test_pull_request_exporter.py
Add datetime fixture to pull request tests                             

integrations/github/tests/github/core/exporters/test_pull_request_exporter.py

  • Added mock_datetime fixture parameter to test methods
    test_get_paginated_resources_various_states and
    test_get_paginated_resources_respects_max_results
  • Added comments to prevent modification of test datetime values in
    TEST_PULL_REQUESTS and mock_datetime fixture
  • Ensured proper datetime mocking for consistent test behavior
+5/-4     

Copy link
Contributor

qodo-merge-pro bot commented Oct 15, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link
Contributor

qodo-merge-pro bot commented Oct 15, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use underscore for unused fixture

Prefix the unused mock_datetime fixture argument with an underscore (_) to
indicate it is only used for its side effects, improving code clarity and
adhering to conventions.

integrations/github/tests/github/core/exporters/test_pull_request_exporter.py [77-83]

 async def test_get_paginated_resources_various_states(
     self,
     rest_client: GithubRestClient,
-    mock_datetime: datetime,
+    _mock_datetime: datetime,
     states: list[str],
     expected_calls: list[dict[str, Any]],
 ) -> None:
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies an unused fixture parameter and proposes following the standard convention of prefixing it with an underscore, which improves code readability.

Low
  • Update

@emekanwaoma emekanwaoma changed the title [Integration][GitHub]: Update Closed Pull Request Tests with Mocked Datetime [Integration][GitHub] Update Closed Pull Request Tests with Mocked Datetime Oct 15, 2025
@github-actions github-actions bot added size/S and removed size/XS labels Oct 15, 2025
Copy link
Member

@mk-armah mk-armah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edenhermelin
Copy link

@mk-armah @emekanwaoma what about this one?
cc: @nivm-port

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.

3 participants