Add tests for all platforms#64
Merged
neel5481 merged 1 commit intoEnterpriseDB:masterfrom Mar 23, 2026
Merged
Conversation
Adds testing infrastructure with make installcheck support for Linux, macOS/Darwin, and Windows platforms. Test Infrastructure: - sql/smoke_test.sql: Quick sanity checks (1-2s runtime) - sql/system_stats.sql: Comprehensive test suite (5-10s runtime) - expected/*.out: Expected output files for regression testing Test Coverage: Tests all 10 system_stats functions: 1. pg_sys_os_info - OS information (name, version, hostname, arch, boot time) 2. pg_sys_cpu_info - CPU details (cores, clock speed, cache, architecture) 3. pg_sys_memory_info - Memory stats (total, used, free, swap) 4. pg_sys_disk_info - Disk information (space, inodes, filesystems) 5. pg_sys_load_avg_info - Load averages (1, 5, 15 minute) 6. pg_sys_cpu_usage_info - CPU usage percentages 7. pg_sys_io_analysis_info - I/O statistics (reads, writes, bytes) 8. pg_sys_process_info - Process counts (running, sleeping, zombie) 9. pg_sys_network_info - Network stats (interfaces, TX/RX, errors) 10. pg_sys_cpu_memory_by_process - Per-process CPU/memory usage Test Categories: - Existence tests: Functions exist and return data - NULL handling: Required fields are populated - Data type validation: Correct PostgreSQL types - Range validation: Values within expected ranges - Consistency checks: Relationships between values are correct - Caching behavior: Multiple calls work correctly - Platform compatibility: Tests pass on Linux, Darwin, Windows
|
This seems like a very important PR. Would be nice to get CI as well but that is probably out of scope here. One thought which may be a bad idea: for linux mock a procfs in git controlled test assets and use that path in a test build instead of /proc so we could deterministically assert the expected values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds testing infrastructure with make installcheck support for Linux, macOS/Darwin, and Windows platforms.
Test Infrastructure:
Test Coverage:
Tests all 10 system_stats functions:
Test Categories: