orionis 0.455.0__py3-none-any.whl → 0.456.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,6 @@
1
1
  from orionis.container.providers.service_provider import ServiceProvider
2
2
  from orionis.test.contracts.unit_test import IUnitTest
3
3
  from orionis.test.core.unit_test import UnitTest
4
- from orionis.foundation.config.testing.entities.testing import Testing
5
- import os
6
4
 
7
5
  class TestingProvider(ServiceProvider):
8
6
  """
@@ -39,87 +37,41 @@ class TestingProvider(ServiceProvider):
39
37
 
40
38
  def register(self) -> None:
41
39
  """
42
- Register the unit testing service in the application container.
40
+ Register and configure the unit testing service in the application container.
43
41
 
44
- This method creates and configures a UnitTest instance using the application's
45
- testing configuration, discovers test files based on specified patterns and paths,
46
- and registers the configured testing service as a singleton in the dependency
47
- injection container with the IUnitTest interface binding.
42
+ This method loads the testing configuration from the application, instantiates
43
+ and configures a UnitTest service, and registers it as a singleton in the
44
+ dependency injection container. The service is bound to the IUnitTest interface
45
+ and is accessible via the alias "x-orionis.test.core.unit_test".
48
46
 
49
47
  The registration process includes:
50
- - Loading testing configuration from the application config
51
- - Creating and configuring a UnitTest instance with various settings
52
- - Discovering test files based on configuration parameters
53
- - Binding the service to the container with alias "x-orionis.test.core.unit_test"
48
+ - Retrieving testing configuration from the application settings.
49
+ - Instantiating the UnitTest service with the appropriate configuration.
50
+ - Registering the UnitTest service as a singleton in the container.
51
+ - Binding the service to the IUnitTest interface and alias.
54
52
 
55
53
  Returns
56
54
  -------
57
55
  None
58
56
  This method does not return any value. It performs side effects by
59
- registering the testing service in the application container.
57
+ registering and binding the testing service in the application container.
60
58
  """
61
59
 
62
- # Load testing configuration from application config and create Testing instance
63
- config = Testing(**self.app.config('testing'))
64
-
65
- # Instantiate the UnitTest implementation with application reference
66
- unit_test = UnitTest(
67
- app=self.app
68
- )
69
-
70
- # Apply configuration settings to the UnitTest instance
71
- unit_test.configure(
72
- verbosity=config.verbosity, # Set output verbosity level
73
- execution_mode=config.execution_mode, # Configure test execution mode
74
- max_workers=config.max_workers, # Set maximum worker threads for parallel execution
75
- fail_fast=config.fail_fast, # Enable/disable fail-fast behavior
76
- print_result=config.print_result, # Control result output printing
77
- throw_exception=config.throw_exception, # Configure exception throwing behavior
78
- persistent=config.persistent, # Enable/disable persistent test results
79
- persistent_driver=config.persistent_driver, # Set persistent storage driver
80
- web_report=config.web_report # Enable/disable web-based reporting
81
- )
82
-
83
- # Discover and load test files based on configuration criteria
84
- unit_test.discoverTests(
85
- base_path=config.base_path, # Root directory for test discovery
86
- folder_path=config.folder_path, # Specific folder path within base_path
87
- pattern=config.pattern, # File name pattern for test files
88
- test_name_pattern=config.test_name_pattern, # Pattern for test method names
89
- tags=config.tags # Tags to filter tests during discovery
90
- )
91
-
92
- # Register the configured UnitTest instance in the DI container
93
- # Binds IUnitTest interface to the UnitTest implementation as a singleton
94
- self.app.instance(IUnitTest, unit_test, alias="x-orionis.test.core.unit_test")
60
+ # Register the UnitTest service as a singleton in the application container.
61
+ # The service is bound to the IUnitTest interface and can be resolved using the alias.
62
+ self.app.singleton(IUnitTest, UnitTest, alias="x-orionis.test.core.unit_test")
95
63
 
96
64
  def boot(self) -> None:
97
65
  """
98
- Perform post-registration initialization for the testing provider.
66
+ Finalize initialization for the testing provider after service registration.
99
67
 
100
- This method is called after the service registration phase to handle any
101
- additional setup required for the testing environment. It ensures that
102
- the necessary storage directories for testing operations are created
103
- and available before test execution begins.
104
-
105
- The boot process includes:
106
- - Creating the testing storage directory if it doesn't exist
107
- - Setting appropriate permissions for the storage path
108
- - Preparing the filesystem structure for test artifacts
68
+ This method is called after the registration phase to allow for any additional
69
+ setup required for the testing environment. In this implementation, no further
70
+ actions are performed during the boot phase.
109
71
 
110
72
  Returns
111
73
  -------
112
74
  None
113
- This method does not return any value. It performs initialization
114
- side effects by creating required directories in the filesystem.
75
+ This method does not return any value.
115
76
  """
116
-
117
- # Retrieve the configured storage path for testing artifacts and temporary files
118
- storage_path = self.app.path('storage_testing')
119
-
120
- # Check if the testing storage directory exists in the filesystem
121
- if not os.path.exists(storage_path):
122
-
123
- # Create the directory structure recursively, including parent directories
124
- # exist_ok=True prevents errors if directory is created by another process
125
- os.makedirs(storage_path, exist_ok=True)
77
+ pass
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.455.0"
8
+ VERSION = "0.456.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -52,6 +52,60 @@ class IUnitTest(ABC):
52
52
  """
53
53
  pass
54
54
 
55
+ @abstractmethod
56
+ def discoverTests(
57
+ self,
58
+ base_path: str | Path,
59
+ folder_path: str | List[str],
60
+ pattern: str,
61
+ test_name_pattern: Optional[str] = None,
62
+ tags: Optional[List[str]] = None
63
+ ) -> 'IUnitTest':
64
+ """
65
+ Discover test cases from specified folders using flexible path discovery.
66
+
67
+ This method provides a convenient way to discover and load test cases from multiple folders
68
+ based on various path specifications. It supports wildcard discovery, single folder loading,
69
+ and multiple folder loading. The method automatically resolves paths relative to the base
70
+ directory and discovers all folders containing files matching the specified pattern.
71
+
72
+ Parameters
73
+ ----------
74
+ base_path : str or Path
75
+ Base directory path for resolving relative folder paths. This serves as the root
76
+ directory from which all folder searches are conducted.
77
+ folder_path : str or list of str
78
+ Specification of folders to search for test cases. Can be:
79
+ - '*' : Discover all folders containing matching files within base_path
80
+ - str : Single folder path relative to base_path
81
+ - list of str : Multiple folder paths relative to base_path
82
+ pattern : str
83
+ File name pattern to match test files, supporting wildcards (* and ?).
84
+ Examples: 'test_*.py', '*_test.py', 'test*.py'
85
+ test_name_pattern : str, optional
86
+ Regular expression pattern to filter test method names. Only tests whose
87
+ names match this pattern will be included. Default is None (no filtering).
88
+ tags : list of str, optional
89
+ List of tags to filter tests. Only tests decorated with matching tags
90
+ will be included. Default is None (no tag filtering).
91
+
92
+ Returns
93
+ -------
94
+ UnitTest
95
+ The current UnitTest instance with discovered tests added to the suite,
96
+ enabling method chaining.
97
+
98
+ Notes
99
+ -----
100
+ - All paths are resolved as absolute paths relative to the base_path
101
+ - When folder_path is '*', the method searches recursively through all subdirectories
102
+ - The method uses the existing discoverTestsInFolder method for actual test discovery
103
+ - Duplicate folders are automatically eliminated using a set data structure
104
+ - The method does not validate the existence of specified folders; validation
105
+ occurs during the actual test discovery process
106
+ """
107
+ pass
108
+
55
109
  @abstractmethod
56
110
  def discoverTestsInFolder(
57
111
  self,
orionis/test/kernel.py CHANGED
@@ -2,6 +2,7 @@ from orionis.console.output.contracts.console import IConsole
2
2
  from orionis.foundation.contracts.application import IApplication
3
3
  from orionis.test.contracts.kernel import ITestKernel
4
4
  from orionis.test.contracts.unit_test import IUnitTest
5
+ from orionis.foundation.config.testing.entities.testing import Testing
5
6
  from orionis.test.exceptions import OrionisTestConfigException, OrionisTestFailureException
6
7
 
7
8
  class TestKernel(ITestKernel):
@@ -38,8 +39,33 @@ class TestKernel(ITestKernel):
38
39
  f"Failed to initialize TestKernel: expected IApplication, got {type(app).__module__}.{type(app).__name__}."
39
40
  )
40
41
 
42
+ # Load testing configuration from application config and create Testing instance
43
+ config = Testing(**app.config('testing'))
44
+
41
45
  # Resolve the unit test service from the application container
42
- self.__unit_test: IUnitTest = app.make('x-orionis.test.core.unit_test')
46
+ self.__unit_test: IUnitTest = app.make('x-orionis.test.core.unit_test', app)
47
+
48
+ # Apply configuration settings to the UnitTest instance
49
+ self.__unit_test.configure(
50
+ verbosity=config.verbosity, # Set output verbosity level
51
+ execution_mode=config.execution_mode, # Configure test execution mode
52
+ max_workers=config.max_workers, # Set maximum worker threads for parallel execution
53
+ fail_fast=config.fail_fast, # Enable/disable fail-fast behavior
54
+ print_result=config.print_result, # Control result output printing
55
+ throw_exception=config.throw_exception, # Configure exception throwing behavior
56
+ persistent=config.persistent, # Enable/disable persistent test results
57
+ persistent_driver=config.persistent_driver, # Set persistent storage driver
58
+ web_report=config.web_report # Enable/disable web-based reporting
59
+ )
60
+
61
+ # Discover and load test files based on configuration criteria
62
+ self.__unit_test.discoverTests(
63
+ base_path=config.base_path, # Root directory for test discovery
64
+ folder_path=config.folder_path, # Specific folder path within base_path
65
+ pattern=config.pattern, # File name pattern for test files
66
+ test_name_pattern=config.test_name_pattern, # Pattern for test method names
67
+ tags=config.tags # Tags to filter tests during discovery
68
+ )
43
69
 
44
70
  # Resolve the console service from the application container
45
71
  self.__console: IConsole = app.make('x-orionis.console.output.console')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.455.0
3
+ Version: 0.456.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -180,10 +180,10 @@ orionis/foundation/providers/inspirational_provider.py,sha256=uq2o0uLd5p6PR99uH4
180
180
  orionis/foundation/providers/logger_provider.py,sha256=bEJug46TNNxuqfCI8eI-GSp0eyNromvBDszQGK-0roc,3607
181
181
  orionis/foundation/providers/progress_bar_provider.py,sha256=X4Ke7mPr0MgVp6WDNaQ3bI3Z_LOS8qE-wid0MQErKms,3367
182
182
  orionis/foundation/providers/reactor_provider.py,sha256=g7X5eyZviQkX2hD7jZof6h1hZmN8rNvODmhGFysfiEY,3712
183
- orionis/foundation/providers/testing_provider.py,sha256=YTubcNnWrG3SPx5NM5HgYefvUYoXdlzXcjljnjavUwM,6462
183
+ orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
184
184
  orionis/foundation/providers/workers_provider.py,sha256=5CvlUETdIblh7Wx8pT0MswTeTCGhYah-EvFqOrLu8Mo,4113
185
185
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
186
- orionis/metadata/framework.py,sha256=JAfHRLGQ0Og0YGg0c-lw57DmKEKRHHsLbF_MiXSsRyI,4088
186
+ orionis/metadata/framework.py,sha256=F5pE_UIelgIj5tk73nlMNZoqHahNmXnoQAl4vkJJjmg,4088
187
187
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
188
188
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
189
189
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -301,7 +301,7 @@ orionis/support/standard/exceptions/value.py,sha256=rsyWFQweImaJGTJa7Id7RhPlwWJ4
301
301
  orionis/support/wrapper/__init__.py,sha256=jGoWoIGYuRYqMYQKlrX7Dpcbg-AGkHoB_aM2xhu73yc,62
302
302
  orionis/support/wrapper/dot_dict.py,sha256=T8xWwwOhBZHNeXRwE_CxvOwG9UFxsLqNmOJjV2CNIrc,7284
303
303
  orionis/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
304
- orionis/test/kernel.py,sha256=iis03o0DH3kc-y2gaLdGxluFi0y4kpWNTBQetQBE24Y,3250
304
+ orionis/test/kernel.py,sha256=iFJh72_YHPzQbeFyOJWU4R9vfWohfElLRU17Ak_Vhos,5024
305
305
  orionis/test/cases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
306
306
  orionis/test/cases/asynchronous.py,sha256=3e1Y3qzIxVU7i7lbLFEVyJ89IA74JsB7famx71W-p2E,1974
307
307
  orionis/test/cases/synchronous.py,sha256=S5jhuDEZ5I9wosrTFaCtowkD5r5HzJH6mKPOdEJcDJE,1734
@@ -312,7 +312,7 @@ orionis/test/contracts/logs.py,sha256=kRH3TGQcTNI0kRxFyEs13Y7NOPP9x9WGitPexnoLzQ
312
312
  orionis/test/contracts/printer.py,sha256=iBz8wHAGaS21VBsHlZQVcx0xu9Bqusb-CLAjj-R1Sjg,3412
313
313
  orionis/test/contracts/render.py,sha256=wpDQzUtT0r8KFZ7zPcxWHXQ1EVNKxzA_rZ6ZKUcZO1c,744
314
314
  orionis/test/contracts/test_result.py,sha256=SNXJ2UerkweYn7uCT0i0HmMGP0XBrL_9KJs-0ZvIYU4,4002
315
- orionis/test/contracts/unit_test.py,sha256=PSnjEyM-QGQ3Pm0ZOqaa8QdPOtilGBVO4R87JYdVa-8,5386
315
+ orionis/test/contracts/unit_test.py,sha256=getqaBoadQT_wh_V6aTQvm0yx9IgbVrE9EEOD8b031g,8031
316
316
  orionis/test/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
317
  orionis/test/core/unit_test.py,sha256=WU107nW5mhLZ8wluhtxkaBNuOKaqAb6BswpdQ-ozCXI,64834
318
318
  orionis/test/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -348,7 +348,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
348
348
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
349
349
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
350
350
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
351
- orionis-0.455.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
351
+ orionis-0.456.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
352
352
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
353
353
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
354
354
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -491,8 +491,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
491
491
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
492
492
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
493
493
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
494
- orionis-0.455.0.dist-info/METADATA,sha256=SUABH7qF9bf2fsAB7sQBWXsVnnFjfXM5-k4vp6i_u2I,4772
495
- orionis-0.455.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
496
- orionis-0.455.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
497
- orionis-0.455.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
498
- orionis-0.455.0.dist-info/RECORD,,
494
+ orionis-0.456.0.dist-info/METADATA,sha256=CuJ0cT18-oNIn-451hxfWvnoA4an7SVDx3Lv9uTvSY4,4772
495
+ orionis-0.456.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
496
+ orionis-0.456.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
497
+ orionis-0.456.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
498
+ orionis-0.456.0.dist-info/RECORD,,