-
Notifications
You must be signed in to change notification settings - Fork 88
feat(integration-tests): Modularize package tests with per-mode directories and module-scoped fixtures. #1843
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
Open
quinntaylormitchell
wants to merge
12
commits into
y-scope:main
Choose a base branch
from
quinntaylormitchell:testing-modular-redesign
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+232
−147
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2f827bb
Implement modular approach.
quinntaylormitchell 890b1e2
Remove sample dataset from this PR.
quinntaylormitchell 7033ab7
Rabbit.
quinntaylormitchell 10efff4
Merge branch 'main' into feature branch
quinntaylormitchell 1ca9095
Address Bill comments.
quinntaylormitchell b466ae7
Update integration-tests/tests/utils/config.py
quinntaylormitchell 07d6a44
Merge branch 'main' into testing-modular-redesign
junhaoliao 255df5e
Address Junhao comments.
quinntaylormitchell 40cfbac
Change data classes to frozen.
quinntaylormitchell d8cf684
Change component_list to tuple.
quinntaylormitchell 434369b
Merge branch 'main' into testing-modular-redesign
junhaoliao a75d909
Merge branch 'main' into feature branch
quinntaylormitchell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Integration tests for the clp-json package.""" |
88 changes: 88 additions & 0 deletions
88
integration-tests/tests/package_tests/clp_json/test_clp_json.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| """Tests for the clp-json package.""" | ||
|
|
||
| import logging | ||
|
|
||
| import pytest | ||
| from clp_py_utils.clp_config import ( | ||
| ClpConfig, | ||
| Package, | ||
| QueryEngine, | ||
| StorageEngine, | ||
| ) | ||
|
|
||
| from tests.utils.asserting_utils import ( | ||
| validate_package_instance, | ||
| ) | ||
| from tests.utils.clp_mode_utils import CLP_API_SERVER_COMPONENT, CLP_BASE_COMPONENTS | ||
| from tests.utils.config import PackageInstance, PackageModeConfig | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| # Mode description for this module. | ||
| CLP_JSON_MODE = PackageModeConfig( | ||
| mode_name="clp-json", | ||
| clp_config=ClpConfig( | ||
| package=Package( | ||
| storage_engine=StorageEngine.CLP_S, | ||
| query_engine=QueryEngine.CLP_S, | ||
| ), | ||
| ), | ||
| component_list=(*CLP_BASE_COMPONENTS, CLP_API_SERVER_COMPONENT), | ||
| ) | ||
|
|
||
|
|
||
| # Pytest markers for this module. | ||
| pytestmark = [ | ||
| pytest.mark.package, | ||
| pytest.mark.clp_json, | ||
| pytest.mark.parametrize("fixt_package_test_config", [CLP_JSON_MODE], indirect=True), | ||
| ] | ||
quinntaylormitchell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| @pytest.mark.startup | ||
| def test_clp_json_startup(fixt_package_instance: PackageInstance) -> None: | ||
| """ | ||
| Validate that the `clp-json` package starts up successfully. | ||
| :param fixt_package_instance: | ||
| """ | ||
| validate_package_instance(fixt_package_instance) | ||
|
|
||
| log_msg = "test_clp_json_startup was successful." | ||
| logger.info(log_msg) | ||
|
|
||
|
|
||
| @pytest.mark.compression | ||
| def test_clp_json_compression(fixt_package_instance: PackageInstance) -> None: | ||
| """ | ||
| Validate that the `clp-json` package successfully compresses some dataset. | ||
| :param fixt_package_instance: | ||
| """ | ||
| validate_package_instance(fixt_package_instance) | ||
|
|
||
| # TODO: compress some dataset and check the correctness of compression. | ||
quinntaylormitchell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| assert True | ||
|
|
||
| log_msg = "test_clp_json_compression was successful." | ||
| logger.info(log_msg) | ||
|
|
||
|
|
||
| @pytest.mark.search | ||
| def test_clp_json_search(fixt_package_instance: PackageInstance) -> None: | ||
| """ | ||
| Validate that the `clp-json` package successfully searches some dataset. | ||
| :param fixt_package_instance: | ||
| """ | ||
| validate_package_instance(fixt_package_instance) | ||
|
|
||
| # TODO: compress some dataset and check the correctness of compression. | ||
|
|
||
| # TODO: search through that dataset and check the correctness of the search results. | ||
|
|
||
| assert True | ||
quinntaylormitchell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| log_msg = "test_clp_json_search was successful." | ||
| logger.info(log_msg) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Integration tests for the clp-text package.""" |
51 changes: 51 additions & 0 deletions
51
integration-tests/tests/package_tests/clp_text/test_clp_text.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| """Tests for the clp-text package.""" | ||
|
|
||
| import logging | ||
|
|
||
| import pytest | ||
| from clp_py_utils.clp_config import ( | ||
| ClpConfig, | ||
| Package, | ||
| QueryEngine, | ||
| StorageEngine, | ||
| ) | ||
|
|
||
| from tests.utils.asserting_utils import ( | ||
| validate_package_instance, | ||
| ) | ||
| from tests.utils.clp_mode_utils import CLP_BASE_COMPONENTS | ||
| from tests.utils.config import PackageInstance, PackageModeConfig | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| # Mode description for this module. | ||
| CLP_TEXT_MODE = PackageModeConfig( | ||
| mode_name="clp-text", | ||
| clp_config=ClpConfig( | ||
| package=Package( | ||
| storage_engine=StorageEngine.CLP, | ||
| query_engine=QueryEngine.CLP, | ||
| ), | ||
| api_server=None, | ||
| log_ingestor=None, | ||
| ), | ||
| component_list=(*CLP_BASE_COMPONENTS,), | ||
| ) | ||
|
|
||
|
|
||
| # Pytest markers for this module. | ||
| pytestmark = [ | ||
| pytest.mark.package, | ||
| pytest.mark.clp_text, | ||
| pytest.mark.parametrize("fixt_package_test_config", [CLP_TEXT_MODE], indirect=True), | ||
| ] | ||
|
|
||
|
|
||
| @pytest.mark.startup | ||
| def test_clp_text_startup(fixt_package_instance: PackageInstance) -> None: | ||
| """Tests package startup.""" | ||
| validate_package_instance(fixt_package_instance) | ||
|
|
||
| log_msg = "test_clp_text_startup was successful." | ||
| logger.info(log_msg) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.