-
Notifications
You must be signed in to change notification settings - Fork 0
Maint/spec cleanup #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the test suite by extracting shared examples to reduce redundancy and consolidating repetitive test cases into more comprehensive tests.
Key Changes
- Introduces two new shared example files for common patterns: memoized resources and HTTP error handling
- Consolidates numerous repetitive test cases across multiple spec files into single tests that verify all parameters at once
- Removes tests for constant values that don't add meaningful coverage
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/support/shared_examples/resource_behavior.rb | New shared examples for memoized resource pattern and port configuration testing |
| spec/support/shared_examples/http_error_handling.rb | New shared examples for HTTP error response handling across different status codes |
| spec/spec_helper.rb | Loads shared example files from support directory |
| spec/pe_client/resources/rbac_v2_spec.rb | Replaces repetitive memoization tests with shared examples |
| spec/pe_client/resources/rbac_v1_spec.rb | Replaces repetitive memoization tests with shared examples |
| spec/pe_client/resources/puppet_v3_spec.rb | Replaces memoization and port configuration tests with shared examples |
| spec/pe_client/resources/puppet_ca_v1_spec.rb | Replaces repetitive memoization tests with shared examples |
| spec/pe_client/resources/node_classifier_v1_spec.rb | Replaces repetitive memoization tests with shared examples |
| spec/pe_client/resources/orchestrator_v1_spec.rb | Replaces memoization tests and consolidates usage endpoint tests |
| spec/pe_client/resources/status_v1_spec.rb | Introduces shared examples for service status endpoints, consolidating repetitive tests |
| spec/pe_client/resources/puppet_ca.v1/certificate_status_spec.rb | Consolidates multiple context-based tests into fewer comprehensive tests |
| spec/pe_client/resources/orchestrator_v1/tasks_spec.rb | Consolidates multiple parameter variation tests into single comprehensive test |
| spec/pe_client/resources/orchestrator_v1/scheduled_jobs_spec.rb | Consolidates query parameter tests into single comprehensive test |
| spec/pe_client/resources/orchestrator_v1/plans_spec.rb | Consolidates multiple parameter variation tests into single comprehensive test |
| spec/pe_client/resources/orchestrator_v1/plan_jobs_spec.rb | Consolidates query parameter tests and event tests |
| spec/pe_client/resources/orchestrator_v1/jobs_spec.rb | Consolidates query parameter tests into single comprehensive tests |
| spec/pe_client/resources/node_inventory_v1_spec.rb | Consolidates parameter variation tests into comprehensive tests |
| spec/pe_client/resources/metrics_v2_spec.rb | Consolidates context-based tests and removes redundant type checks |
| spec/pe_client/resources/metrics_v1_spec.rb | Consolidates context-based tests for metric retrieval |
| spec/pe_client/resources/code_manager_v1_spec.rb | Removes individual optional parameter tests, keeps comprehensive test |
| spec/pe_client/resources/activity_v2_spec.rb | Consolidates extensive parameter variation tests into fewer comprehensive tests |
| spec/pe_client/resources/activity_v1_spec.rb | Consolidates extensive parameter variation tests into fewer comprehensive tests |
| spec/pe_client/resources/puppet_v3/file_metadata_spec.rb | Removes constant value tests |
| spec/pe_client/resources/puppet_v3/file_bucket_spec.rb | Removes constant value tests |
| spec/pe_client/client_spec.rb | Replaces individual HTTP error tests with shared examples, replaces memoization tests with shared examples, simplifies deep_dup test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cleaning up spec redundancy and irrelative tests.