Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Improve tests reliability and logging
Squashed commit of the following: commit 1b5a02c05014481076e7b6d8b08f25ccc3d3064d Author: Wojtek Majewski <[email protected]> Date: Sun Jan 12 00:12:19 2025 +0100 style(logging): Improve console log formatting across Supabase functions Standardized log messages in multiple Supaworker functions by: - Adding function-specific prefixes to log messages - Updating log message formatting for consistency - Maintaining existing functionality while enhancing readability commit 4dffa6417182ba738bc16c1a7297a9e5b3b14496 Author: Wojtek Majewski <[email protected]> Date: Sat Jan 11 23:26:45 2025 +0100 test(restarts): improve error handling and assertions in worker restart test Add error handling for queue drop and enhance worker spawn verification - Wrap queue drop in try-catch to prevent test failures - Update sequence value assertion method - Improve worker spawn length check commit 21803e735e96100a04abef6f693586bd2205dbe0 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 23:47:19 2025 +0100 chore(supaworker): reduce max Postgres connections Lowered max Postgres connections from 50 to 20 in Supaworker configuration commit b4c4a00b2f8e244fc8b5a66b9cfd88535d795272 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 23:46:12 2025 +0100 test(restarts): simplify worker spawn test assertions Refactored test code to use async/await and remove redundant variable assignments, improving test readability and reducing unnecessary code commit 0cc3d65450597fbc3a306e4bfec241142b37a98a Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 17:36:17 2025 +0100 chore(deno): add configuration files for max_concurrency function Initialize Deno project configuration with dependency imports and lock file for Supabase function commit 27978340534151bb83cffbbe3012ecbaee995aba Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 17:32:23 2025 +0100 refactor(deps): update dependencies and improve logging Update Deno standard library to version 0.224.0 Replace manual ANSI color codes with dim() color utility Enhance worker spawn logging with progress bar improvements commit ebf918463f59cf05284e763a1bf0f52b102544fd Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 17:30:51 2025 +0100 chore(config): increase PostgreSQL connection pool default size Adjust default pool size from 20 to 100 connections to support higher concurrency requirements commit d33b5d6a411b9c0016fbce5b3b3e807a2c14dda8 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 15:24:05 2025 +0100 refactor(tests): standardize logging and import helper function Replaced console.log calls with a new log helper function across multiple test files to improve logging consistency and readability commit 7666c483e05b3321f6fe3ec88cbd6389e5ffeca6 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 15:02:19 2025 +0100 fix(sql): silence postgres notices by adding onnotice handler Suppress unnecessary database notices during testing by adding a no-op handler to the postgres connection configuration commit 4c56dc7b698e428ada5d93073eb8e7d9f2b62cc9 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 14:19:17 2025 +0100 refactor(supaworker): Make tests more reliable - rename functions - make each use separate queue and maintain it - send and assert on particular queues - wait for exact number of workers in maxConcurrent commit db576cc4d5add1e8ba09cb035ff30247accbb712 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 12:55:29 2025 +0100 test(worker): update CPU-intensive worker test and logging Modify test case for worker spawning with reduced message count and timeout Simplify CPU-intensive task logging and sequence value retrieval Remove unnecessary assertions and debug code from test Reduces test complexity and improves worker test reliability commit 3ae76ff929cf8fc165c217d5e0a5c5aa12f020b9 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 12:43:46 2025 +0100 chore(deps): Add Deno configuration and lock files for CPU-intensive function Configure Deno project dependencies for Supabase function, including PostgreSQL library import and dependency lockfile commit 51781a6c58eced35e2a64c40fc2f92be7a7ab83b Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 12:31:47 2025 +0100 test(worker): enhance worker spawn test with improved assertions and timeout Improve end-to-end test for worker spawning by: - Adding fetchWorkers helper function - Increasing timeout for sequence increment - Adding assertion to verify multiple workers are spawned - Cleaning up inactive workers before test - Replacing assertGreaterOrEqual with assertGreater for worker count check commit d22e575118ca63bb79150e13ea2970bcb85a4186 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 11:37:26 2025 +0100 test(helpers): update sequence wait helper function name Rename waitForSeqValue to waitForSeqToIncrementBy in test helper functions Update import statements in two test files to reflect the new helper function name commit a51fa24c4d2a67ca7ab8f77f84a86534a8f75da0 Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 11:31:10 2025 +0100 refactor(testing): improve async utility functions and sequence handling Refactored test helper functions to use a more generic waitFor utility with configurable options. Updated sequence value tracking and added more robust timeout and polling mechanisms for async testing scenarios. Key changes: - Introduced generic waitFor function with configurable polling and timeout - Refactored waitForSeqToIncrementBy to use new waitFor utility - Improved sequence value retrieval logic - Simplified active worker waiting mechanism - Added more descriptive error handling for async operations commit f6958fc58d60b61be5766c07c006e6f5a8eaefdd Author: Wojtek Majewski <[email protected]> Date: Fri Jan 10 00:59:28 2025 +0100 feat(tests): improve worker testing and progress tracking Update test helpers with progress bar, optimize worker spawning, and adjust test parameters - Add progress bar for sequence value waiting - Reduce polling interval and modify test batch size - Simplify worker startup process - Update dependencies in deno.lock - Remove unnecessary console logs commit ea266cfcd2583fe97c31d65cd81aa35fe3f7b07e Author: Wojtek Majewski <[email protected]> Date: Thu Jan 9 23:56:33 2025 +0100 test(supaworker): Enhance e2e test helpers and test cases Improve test utility functions with more flexible sequence and worker tracking: - Add sendBatch helper function for sending test messages - Extend seqLastValue to support custom sequence names - Implement waitForSeqValue with configurable polling and timeout - Add waitForActiveWorker to check worker availability - Update test cases to use new helper functions - Improve message batch sending and sequence value assertions commit 2cf9fa04b6c6bc2b7a38f29f98d08dfe36abfb03 Author: Wojtek Majewski <[email protected]> Date: Thu Jan 9 23:56:08 2025 +0100 refactor(worker): remove sequence restart command Remove unnecessary sequence restart operation in serial sleep worker commit 9ed343a96a7f2696a4940502e54ecbd66e70ed1f Author: Wojtek Majewski <[email protected]> Date: Thu Jan 9 23:55:25 2025 +0100 refactor(sequence): simplify sequence increment function Streamline sequence creation and logging by removing unnecessary console logs and simplifying the incrementCounter function implementation commit fd116e9b6bf0457d485a22ca91cee180e52e8e03 Author: Wojtek Majewski <[email protected]> Date: Thu Jan 9 23:52:43 2025 +0100 chore(deps): downgrade supabase dependency to v2.1.4 Fixes problem with console.log output in Deno commit d5dc436a7f95851e6f32a7f89d34e5fe328cd9f7 Author: Wojtek Majewski <[email protected]> Date: Thu Jan 9 23:52:21 2025 +0100 chore(nx): streamline Supabase and project configuration Simplified project.json commands by removing unnecessary array brackets and consolidating Supabase-related task configurations. Added new 'supabase:status' task and updated dependency and command structures for various project tasks.
- Loading branch information