Skip to content

Conversation

@zaben903
Copy link
Collaborator

Cleaning up spec redundancy and irrelative tests.

Copy link

Copilot AI left a 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.

@zaben903 zaben903 merged commit 1a5a5b2 into main Dec 19, 2025
9 checks passed
@zaben903 zaben903 deleted the maint/spec_cleanup branch December 19, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants