Skip to content

Conversation

p123-stack
Copy link
Collaborator

No description provided.

@p123-stack p123-stack force-pushed the test_summary branch 3 times, most recently from bfb1ba2 to 510d0bc Compare May 14, 2025 12:33
@transistive
Copy link
Collaborator

Excellent work @p123-stack !

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes issues with direct driver tests and updates the test summary along with several supporting refactorings.

  • Updated tests to conditionally skip problematic tests in CI.
  • Refactored response serialization, query type enum constants, and logging.
  • Replaced the old ProfiledPlan with a new ProfiledQueryPlan and updated related data classes.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Integration/ComplexQueryTest.php Added CI check to skip tests affected by a known memory bug.
testkit-backend/testkit.sh Updated environment variables and test commands (with --teamcity flag).
testkit-backend/src/Responses/SummaryResponse.php Updated JSON serialization for summary responses and parameter formatting.
testkit-backend/src/Handlers/TransactionRun.php Added docblock for the request parameter.
testkit-backend/src/Handlers/TransactionCommit.php Changed transaction interface check to use UnmanagedTransactionInterface.
testkit-backend/src/Backend.php Removed duplicate logging and added a cutoff utility for long log messages.
src/Formatter/SummarizedResultFormatter.php Modified result summary formatting and introduced conversion and mapping improvements.
src/Enum/QueryTypeEnum.php Changed enum constant values to abbreviated forms.
src/Databags/ServerInfo.php Added a jsonSerialize method for consistent output.
src/Databags/ResultSummary.php Updated return types and documentation for timing values and plan types.
src/Databags/ProfiledQueryPlan.php Introduced a new data class replacing the old ProfiledPlan.
src/Databags/ProfiledPlan.php Removed the outdated ProfiledPlan class.
src/Databags/Position.php Renamed InputPosition to Position and adjusted property mutability and order.
src/Databags/PlanArguments.php Added a new class for plan argument encapsulation.
src/Databags/Plan.php Refactored the Plan class to use plain arrays and the new PlanArguments.
src/Databags/Notification.php Updated notification parsing logic and error handling in code splitting.
.github/workflows/* Updated workflow scripts to set CI environment variable and include --teamcity flag.
Comments suppressed due to low confidence (3)

src/Databags/Position.php:22

  • [nitpick] The Position class now uses mutable properties instead of being immutable as before. If immutability was intended, consider using readonly properties to enforce this behavior.
private int $column, private int $offset, private int $line,

src/Enum/QueryTypeEnum.php:37

  • The constants in QueryTypeEnum have been abbreviated (e.g., 'r' instead of 'read_only'). Ensure these new values are aligned with all API consumers and that appropriate documentation updates are made if necessary.
private const READ_ONLY = 'r';

src/Databags/Notification.php:38

  • The splitCode method expects the notification code to consist of at least 4 parts. Ensure that all notification codes conform to this format or consider adding fallback handling to avoid unexpected exceptions.
if (count($parts) < 4) {

Comment on lines +186 to +187
(int) ($resultAvailableAfter * 1000),
(int) ($resultConsumedAfter * 1000),
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Converting timing values to int by multiplying by 1000 may result in a loss of precision. Consider documenting the conversion behavior or using a rounding function to ensure consistency in the reported timings.

Suggested change
(int) ($resultAvailableAfter * 1000),
(int) ($resultConsumedAfter * 1000),
(int) round($resultAvailableAfter * 1000), // Rounded to ensure consistent millisecond precision
(int) round($resultConsumedAfter * 1000), // Rounded to ensure consistent millisecond precision

Copilot uses AI. Check for mistakes.

@transistive transistive merged commit 344f1a1 into main May 14, 2025
27 of 28 checks passed
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.

2 participants