Skip to content

CSPL-3775 extract common code in tests#1788

Open
kasiakoziol wants to merge 51 commits intodevelopfrom
feature/CSPL-3775-extract-common-code-in-tests
Open

CSPL-3775 extract common code in tests#1788
kasiakoziol wants to merge 51 commits intodevelopfrom
feature/CSPL-3775-extract-common-code-in-tests

Conversation

@kasiakoziol
Copy link
Copy Markdown
Collaborator

@kasiakoziol kasiakoziol commented Mar 20, 2026

Description

It extracts common code under test/ to remove duplicates and enhance test readability and usability.

Key Changes

  • Consolidate duplicate V3 (master) and V4 (manager) test files into shared _shared.go + _test.go pairs with table-driven version configs
  • Delete ~30 redundant per-variant files (~5000 lines removed)
  • Add reusable version-aware deploy and verify helpers to the shared test utilities
  • Add watch-based verification utilities for faster and more reliable phase checks
  • Extract repeated multi-line verification patterns into shared helper functions
  • Inline single-use helpers and replace inline closures with reusable typed methods
  • Remove redundant guard clauses, double-verification calls, and dead code
  • Simplify variable declarations and replace hardcoded strings with constants
  • Fix naming conventions, add missing godoc, and standardize comments
  • Adopt shared helpers across appframework tests to reduce inline boilerplate

Testing and Verification

Automated tests

Related Issues

Jira: https://splunk.atlassian.net/browse/CSPL-4515

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

kasiakoziol and others added 29 commits March 16, 2026 07:05
* CSPL-4397 Remove time dependency from tests

* CSPL-4397 Removing test reliance on time

* CSPL-4397 Adjusting timeouts

* CSPL-4354 Fixing time dependencies in unit tests and fixing timeouts in integ tests

* CSPL-4397 Move to using watch

* CSPL-4397 Refactor pod reset detection to use UID-based tracking instead of time-based comparison, add fail-fast test prerequisites validation, and improve code clarity with variable renaming

* CSPL-4397 Refactoring

* CSPL-4397 Addressing comments
…1768)

* CSPL-4602 Moving duplicated code for LM tests to a shared codebase

* CSPL-4602 Addinf license manager tests to workflows

* CSPL-4602 Address comments

* CSPL-4602 Moving LM shared test utils to licensemanager package

* CSPL-4602 Addressing base branch changes
* CSPL-4377 Get rid of not expected panic in tests

* CSPL-4377 Check error for app disablement in tests
…nts, removing duplicate helpers, replacing inline logic with shared utilities
* Enhance error handling in WaitforPhaseChange and fix variable name in NewTestCaseEnv

* Updated WaitforPhaseChange to log an error if the phase transition is not observed within the timeout.
* Corrected the variable name check in NewTestCaseEnv to use the provided name instead of an uninitialized envName.
* Changed Kind from "ClusterManager" to "ClusterMaster" in ClusterMaster struct.

* Update error logging in WaitforPhaseChange to use Error level for timeout observations
…ode, and standardize naming, godoc comments, and constants for consistency
@kasiakoziol kasiakoziol marked this pull request as ready for review April 7, 2026 10:53
@kasiakoziol kasiakoziol changed the title Feature/cspl 3775 extract common code in tests CSPL-3775 extract common code in tests Apr 7, 2026
@kasiakoziol kasiakoziol requested a review from kubabuczak April 7, 2026 11:46
@kasiakoziol kasiakoziol force-pushed the feature/CSPL-3775-extract-common-code-in-tests branch from a49e621 to 2926a35 Compare April 10, 2026 08:27
Copy link
Copy Markdown
Collaborator

@kubabuczak kubabuczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Let's merge it and start iterating on top of this change

One thing to double check: Verify CI pipeline label selectors still match reformatted test labels

Base automatically changed from feature/test-refactoring to develop April 14, 2026 17:57
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.

5 participants