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.
This pull request introduces significant refactoring and improvements to the test suite for the TDP CLI application. The changes focus on modularizing the test setup, enhancing reusability, and improving the clarity of test cases. Key updates include the removal of redundant code, the introduction of helper methods, and the addition of new integration tests for the CLI.
Refactoring and modularization of test fixtures:
tests/conftest.py
: Removed unused imports and redundant database-related fixtures (db_engine
,create_session
, etc.). Introduced modular helper functions (init_dag_directory
,init_playbooks_directory
,init_default_vars_directory
) for creating test collections. Simplified thegenerate_collection_at_path
function to use these helpers. [1] [2] [3] [4]tests/e2e/conftest.py
: Replaced theTDPInitArgs
class with a more flexibleCollectionPath
class, which provides methods for initializing directories. Added acollection_path_factory
fixture for creating multiple collections in tests. Simplified thetdp
fixture to invoke CLI commands with a runner.Updated existing tests cases to use the new fixtures.
Enhanced CLI integration tests:
tests/e2e/test_tdp.py
: Added new tests to validate CLI functionality, including help messages, command routing, and global options. These tests ensure consistent behavior across commands and subcommands.tdp init
command intests/e2e/test_tdp_init.py
.These changes improve the maintainability and scalability of the test suite, making it easier to add new tests and adapt to future changes in the codebase.
Agreements