Conversation
Create pkg/tests package that wraps GoConvey with RSpec-like syntax using Describe, Context, It, and Expect. This provides more readable and maintainable test structure while keeping GoConvey's powerful assertion matchers. Benefits: - Single import (. "github.com/pgconfig/api/pkg/tests") - Familiar RSpec syntax for better readability - Re-exports all GoConvey matchers (ShouldEqual, ShouldBeNil, etc) - Cleaner hierarchical test output - Easier for Ruby/RSpec developers to understand Convert profile tests to demonstrate new testing style. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Convert all test files in cmd/ package to use new BDD testing style with hybrid approach combining table-driven tests and RSpec-like structure. This improves test readability while maintaining the efficiency of table-driven patterns. Changes: - cmd/api/main_test.go: Simple BDD conversion - cmd/api/handlers/v1/config_test.go: Hybrid with captured args to avoid goroutine assertion issues in Fiber handlers - cmd/pgconfigctl/main_test.go: Compact table format inside It block Benefits: - More descriptive test output with nested contexts - Maintains test table efficiency for multiple cases - Consistent testing style across codebase - 63 lines removed through more concise test structure Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Convert remaining input package tests and version tests to RSpec-style BDD format. Both packages already used GoConvey, just needed import updates and structure improvements. Changes: - pkg/input/bytes: Use Context/It with hybrid table-driven approach for formatting tests, keeps test data compact - pkg/version: Simple Describe/It conversion Both maintain the same test coverage with more readable structure. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Fix "go: no such tool covdata" error when running tests with coverage in Go 1.25. This is a known issue where the covdata tool cannot be found with GOTOOLCHAIN=auto. Reference: golang/go#75031 Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Convert worker_test.go to use the new BDD-style test framework with Describe/Context/It structure. Maintain hybrid approach with compact table-driven tests inside It blocks for efficiency. Reduces test code from 136 to 53 lines while improving readability and maintaining all 27 assertions. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Convert all three format tests (alter_test.go, conf_test.go, sg_config_test.go) to use BDD-style Describe/It structure for improved readability and consistency with project test standards. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Convert all 7 rules test files to use BDD-style Describe/Context/It structure. Maintain hybrid approach with compact table-driven tests where appropriate for efficiency. Major improvements: - aio_test: 292 to 62 lines (230 lines removed) - compute_test: Consolidated into 2 focused tests - os_test: Better organization with Windows-specific Context - version_test: Clear Context groupings per PostgreSQL version All 148 assertions passing. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
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.
some refactors to use rspec like tests. pkg/tests is a simple wrap from the GoConvey package