Commit Graph

7 Commits

Author SHA1 Message Date
Ophir Lojkine 34e361ca4a tests: cap actix workers to prevent fd exhaustion
cargo test was failing with too many open files because each test server
spawned a worker per CPU, quickly exhausting file descriptors when tests ran
in parallel. Set test servers to one worker so they use a bounded number of
sockets/threads, avoiding fd exhaustion and letting OIDC and migration tests
start reliably.
2025-12-23 14:16:37 +01:00
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 5ade60fa95 Return plain text 404 for non-HTML requests
Checks the `Accept` header for 404 responses. If HTML is not
preferred, a plain text 404 is returned, avoiding the
`_default_404.sql` processing. HTML-preferring clients
continue to receive the custom SQL-based 404 page.
2025-05-30 22:49:26 +02:00
lovasoa e7951ee721 dynamic port choice
also: better error messages in tests
2025-05-26 00:46:04 +02:00
lovasoa 7009f65374 run sql test files 2025-05-26 00:05:45 +02:00
lovasoa acdc03891d clippy fixes 2025-05-25 23:22:41 +02:00
lovasoa 5cbd12fcfd reorganize tests: better structure 2025-05-25 23:20:31 +02:00