Skip to content

chore(tests): updating the test strategy to be more parrallel#85

Merged
Jacobbrewer1 merged 3 commits intomainfrom
chore/testing-strat
Jul 7, 2025
Merged

chore(tests): updating the test strategy to be more parrallel#85
Jacobbrewer1 merged 3 commits intomainfrom
chore/testing-strat

Conversation

@Jacobbrewer1
Copy link
Owner

Describe your changes

This pull request primarily focuses on improving test organization and parallelization across multiple files. It introduces subtests for better readability and structure, removes redundant helper methods, and ensures tests run in parallel where applicable.

Test organization improvements:

  • k8s/resource_test.go: Consolidated multiple test functions into subtests using t.Run for better organization and readability. Updated test names to reflect specific scenarios, such as "create configmap error" and "update secret error". [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • slices/set_test.go: Reorganized tests into subtests using t.Run for operations like "Difference", "Items", "Each", and "Union". This enhances test clarity and structure. [1] [2] [3] [4] [5]

Parallelization enhancements:

Removal of redundant code:

  • logging/config_test.go: Removed the setEnv helper method and directly used t.Setenv for setting environment variables in tests. This simplifies the code and reduces unnecessary abstraction. [1] [2]

@Jacobbrewer1 Jacobbrewer1 marked this pull request as ready for review July 7, 2025 09:07
Copilot AI review requested due to automatic review settings July 7, 2025 09:07
Copy link
Contributor

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 restructures existing tests into subtests, enables parallel execution where appropriate, and removes redundant helper code to streamline the test suite.

  • Converts standalone test functions into t.Run subtests for clearer organization
  • Adds t.Parallel() calls to improve test parallelism
  • Removes the custom setEnv helper in favor of using t.Setenv directly

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
slices/set_test.go Consolidated multiple Test_Set_* functions into subtests under Test_Set, added t.Parallel()
logging/logger_test.go Wrapped TestNewLogger cases in subtests with t.Parallel(), added parallelism to TestDuplicateKey
logging/config_test.go Removed setEnv helper and replaced calls with direct t.Setenv
k8s/resource_test.go Converted several top-level TestUpsertResource_* functions into subtests with consistent naming and parallelism
health/result_test.go Added an explicit fatal check after length assertion in compareResult
cache/fixed_hash_bucket_test.go Enabled parallel execution for Test_FixedHashBucket
Comments suppressed due to low confidence (1)

k8s/resource_test.go:54

  • [nitpick] Consider adding t.Parallel() at the start of TestUpsertResource so that its subtests can run in parallel with other tests.
		err := UpsertResource(ctx, kubeClient, secret)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Jacobbrewer1 Jacobbrewer1 enabled auto-merge (squash) July 7, 2025 09:13
@Jacobbrewer1 Jacobbrewer1 merged commit 24a6ffd into main Jul 7, 2025
5 checks passed
@Jacobbrewer1 Jacobbrewer1 deleted the chore/testing-strat branch July 7, 2025 09:14
@github-actions
Copy link

github-actions bot commented Aug 7, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants