Commit Graph

6 Commits

Author SHA1 Message Date
Ophir LOJKINE 95f228f383 simplify SQL test files (#1129)
* simplify SQL test files

- Simplified SQL test files by removing unnecessary components and restructuring queries to focus on expected vs actual results.
- Updated the request handling in `run_sql_test` to differentiate between JSON and HTML responses based on test file content.
- Enhanced error handling and assertions for both JSON and HTML responses to improve test reliability and clarity.
- Removed redundant code and improved readability in the test execution flow.

* move more tests to the new expected/actual format

* migrate more tests to the expected/actual format

- Changed references in various test files to point to the new `simple.sql` instead of the outdated `it_works_simple.sql`.
- Removed several obsolete SQL test files that are no longer needed, streamlining the test suite.
- Updated assertions and request paths in the test cases to reflect the new structure and improve clarity.

* Enhance error handling in SQL tests and update SQL syntax

- Added a new function `format_error` to improve error reporting in SQL test assertions, capturing detailed error descriptions and backtraces.
- Updated SQL syntax in `sqrt.sql` to use `INT` instead of `integer` for consistency with SQL standards.

* sqrt test
2025-11-26 00:45:13 +01:00
lovasoa c803214766 Add server timing for parameter binding in query execution
- Recorded server timing for the parameter binding process in the query execution flow.
- Updated tests to verify the inclusion of the new timing event in the server timing header.
2025-10-28 16:18:05 +01:00
lovasoa 1e396ac095 Fix missing server timing in some cases
- Updated response handling to use a builder pattern for better clarity and consistency.
- Enhanced server timing format to include microseconds in the output.
- Added a new test for server timing in redirect responses to ensure proper header inclusion.
2025-10-28 16:08:40 +01:00
lovasoa 06df761eee Refactor: Update ServerTiming to use Arc and simplify header generation
This commit modifies the ServerTiming structure to utilize Arc for thread-safe reference counting, enhancing performance and memory management. The header generation logic is streamlined, and related code is updated to reflect these changes. Additionally, tests are adjusted to ensure proper functionality with the new implementation.

Co-authored-by: contact <contact@ophir.dev>
2025-10-23 12:42:09 +02:00
Cursor Agent 38e08d78d1 Refactor: Pass ServerTiming to extract_request_info
Co-authored-by: contact <contact@ophir.dev>
2025-10-22 22:08:10 +00:00
Cursor Agent 5c415984bf Refactor Server-Timing header generation and add tests
This commit refactors the Server-Timing header generation to be more efficient and adds comprehensive tests for its behavior in development and production environments. It also includes a new test SQL file for server timing verification.

Co-authored-by: contact <contact@ophir.dev>
2025-10-22 20:03:09 +00:00