codecraftai-testplus 1.2.2__tar.gz → 1.3.0__tar.gz
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.
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/LICENSE.md +30 -21
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/PKG-INFO +1 -1
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/pyproject.toml +1 -1
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/testing/jobs.py +38 -11
- codecraftai_testplus-1.3.0/source/packages/ccai/testplus/cli/cmdtree/testing/options.py +67 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/testing/run.py +3 -1
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/entrypoints.py +31 -17
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/README.rst +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/__init__.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/__init__.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/__init__.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/testing/__init__.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/testing/constants.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/cmdtree/testing/query.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/cli/testplus_command.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/distributedtestjob.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/distributedtestsequencer.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/initialize.py +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/py.typed +0 -0
- {codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/testplusdefaulttypefactory.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Code Craft AI - Source Available License
|
|
2
|
-
Version 1.
|
|
2
|
+
Version 1.1, November 2026
|
|
3
3
|
|
|
4
4
|
Copyright (C) 2026, Code Craft AI LLC
|
|
5
5
|
|
|
@@ -7,12 +7,12 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
7
7
|
|
|
8
8
|
*This License* covers the Python Automation Kit, the full suite of software published by *Licensor* that consists of every `codecraftai-*` package, every `pychestrate` package, and the `pychestrate` server.
|
|
9
9
|
|
|
10
|
-
*The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. When a company migrates a product or service to *The Software* from another code base, the *
|
|
10
|
+
*The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. That estimation starts from *Gross Income*, not net profit, so spending on research and development or other operating expenses does not reduce it. When a company migrates a product or service to *The Software* from another code base, the *Gross Income* from that product or service is not counted toward the *Usage Fee* for two years, as described in section 5.4. For assurance of costs, a company can disclose its usage and estimated returns to *Licensor* and negotiate a fixed license cost, as described in section 5.10.
|
|
11
11
|
|
|
12
12
|
## 1. Definitions
|
|
13
13
|
|
|
14
14
|
### 1.1 *This License* or *The License*
|
|
15
|
-
**This License** or **The License** refers to version 1.
|
|
15
|
+
**This License** or **The License** refers to version 1.1 of the Code Craft AI - Source Available License.
|
|
16
16
|
|
|
17
17
|
### 1.2 Licensor
|
|
18
18
|
**Licensor** refers to Code Craft AI LLC.
|
|
@@ -42,14 +42,14 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
42
42
|
### 1.9 Fiscal Year
|
|
43
43
|
**Fiscal Year** means the annual accounting period that *You* use for financial reporting.
|
|
44
44
|
|
|
45
|
-
### 1.10
|
|
46
|
-
**
|
|
45
|
+
### 1.10 Gross Income
|
|
46
|
+
**Gross Income** means, for each product or service in connection with which *You* make *Commercial Use* of *The Software*, the gross profit that *You* earn from that product or service during a *Fiscal Year*: the revenue from that product or service, less its cost of goods sold or cost of revenue, determined under the accounting principles that *You* regularly use for financial reporting. *Gross Income* is calculated before operating expenses, such as research and development, sales and marketing, and general and administrative expenses, and before interest and taxes. *Gross Income* is measured for the products and services that *The Software* is used for, not for *Your* business as a whole.
|
|
47
47
|
|
|
48
48
|
### 1.11 Contribution Estimate
|
|
49
|
-
**Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *
|
|
49
|
+
**Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *Gross Income* that *The Software* contributed to, expressed as a number from 0 to 1.
|
|
50
50
|
|
|
51
51
|
### 1.12 Derived Income
|
|
52
|
-
**Derived Income** means the portion of the *
|
|
52
|
+
**Derived Income** means the portion of the *Gross Income* for a *Fiscal Year* that is derived from *The Software*, calculated as described in section 5.2.
|
|
53
53
|
|
|
54
54
|
### 1.13 Usage Fee
|
|
55
55
|
**Usage Fee** means the yearly fee for *Commercial Use* that is set by the table in section 5.3.
|
|
@@ -58,7 +58,7 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
58
58
|
**Migration** means moving the work for one of *Your* products or services from a code base other than *The Software*, such as another framework, another library, or *Your* own code, to *The Software*.
|
|
59
59
|
|
|
60
60
|
### 1.15 Migration Period
|
|
61
|
-
**Migration Period** means the two (2) year period, described in section 5.4, during which the *
|
|
61
|
+
**Migration Period** means the two (2) year period, described in section 5.4, during which the *Gross Income* from a product or service that *You* are migrating to *The Software* is not counted.
|
|
62
62
|
|
|
63
63
|
## 2. License Grant
|
|
64
64
|
|
|
@@ -96,11 +96,11 @@ For each *Fiscal Year* in which *You* make *Commercial Use* of *The Software*, *
|
|
|
96
96
|
### 5.2 Derived Income
|
|
97
97
|
The *Derived Income* for a *Fiscal Year* is calculated as follows:
|
|
98
98
|
|
|
99
|
-
(Contribution Estimate) * (
|
|
99
|
+
(Contribution Estimate) * (Gross Income) = (Derived Income)
|
|
100
100
|
|
|
101
|
-
If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *
|
|
101
|
+
If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *Gross Income*, and add the results together. The *Gross Income* from a product or service that is in its *Migration Period* is not counted, as described in section 5.4.
|
|
102
102
|
|
|
103
|
-
If the *
|
|
103
|
+
If the *Gross Income* from a product or service for a *Fiscal Year* is zero or less, then the *Derived Income* from that product or service for that *Fiscal Year* is zero.
|
|
104
104
|
|
|
105
105
|
### 5.3 Usage Fee
|
|
106
106
|
The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fiscal Year*, as shown in the following table.
|
|
@@ -113,56 +113,65 @@ The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fis
|
|
|
113
113
|
| More than 100,000,000, up to and including 1,000,000,000 | 250,000 |
|
|
114
114
|
| More than 1,000,000,000 | 500,000 |
|
|
115
115
|
|
|
116
|
-
All amounts in this section 5 are in United States dollars. If *You* report *
|
|
116
|
+
All amounts in this section 5 are in United States dollars. If *You* report *Gross Income* in a different currency, convert the *Derived Income* to United States dollars using the average exchange rate for the *Fiscal Year*.
|
|
117
117
|
|
|
118
118
|
### 5.4 Migration Allowance
|
|
119
|
-
When *You* migrate a product or service to *The Software*, the *
|
|
119
|
+
When *You* migrate a product or service to *The Software*, the *Gross Income* from that product or service is not counted when calculating the *Derived Income* during its *Migration Period* (the **Migration Allowance**).
|
|
120
120
|
|
|
121
121
|
The *Migration Period* for a product or service begins on the date that *You* first make *Commercial Use* of *The Software* for that product or service as part of its *Migration*, and ends two (2) years after that date.
|
|
122
122
|
|
|
123
123
|
The *Migration Allowance* applies to each product or service separately, and *You* may use it for every product or service that *You* migrate. Each product or service has only one *Migration Period*.
|
|
124
124
|
|
|
125
|
-
If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *
|
|
125
|
+
If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *Gross Income* from that product or service for that *Fiscal Year* is reduced in proportion to the number of days of that *Fiscal Year* that fall within its *Migration Period*.
|
|
126
126
|
|
|
127
|
-
For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *
|
|
127
|
+
For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *Gross Income* from product A. On March 1, 2027, the company begins moving the testing of product B from a different test framework to *The Software*. The company does not count the *Gross Income* from product B in its *Derived Income* from March 1, 2027 until March 1, 2029. Starting March 1, 2029, the *Gross Income* from product B is counted. If the company later migrates product C, the *Gross Income* from product C is not counted for two years from the start of its own *Migration*.
|
|
128
128
|
|
|
129
129
|
### 5.5 Contribution Estimate
|
|
130
130
|
*You* are responsible for making the *Contribution Estimate*. A *Contribution Estimate* must be reasonable and made in good faith. The *Contribution Estimate* for a product or service covers all of the *Components* that *You* *Use* for that product or service. When making the *Contribution Estimate*, *You* should consider how important *The Software* is to the *Commercial Activity*, how much of the *Commercial Activity* depends on *The Software*, and the effort and cost that *You* would otherwise need to spend to accomplish what *The Software* accomplishes for *You*.
|
|
131
131
|
|
|
132
132
|
The following table is a guide for making the *Contribution Estimate*. When *Your* *Commercial Use* of *The Software* matches an entry in the table, the *Contribution Estimate* in that entry is a reasonable *Contribution Estimate*. When *Your* *Commercial Use* does not match an entry in the table, make the *Contribution Estimate* by comparing *Your* *Commercial Use* with the entries in the table. When more than one entry matches the same *Commercial Activity*, use the entry with the highest *Contribution Estimate*.
|
|
133
133
|
|
|
134
|
+
Many products are not software, such as devices, machines, vehicles, and other physical goods, and software accounts for only part of what such a product is worth. For a product or service that is not software, *You* may reduce the *Contribution Estimate* in proportion to the share of the value of the shipped product that its software reasonably accounts for. To do so, multiply the *Contribution Estimate* from the table by that share, expressed as a number from 0 to 1. *You* must keep records that reasonably support that share, as described in section 5.8.
|
|
135
|
+
|
|
134
136
|
| Commercial Use of *The Software* | Contribution Estimate |
|
|
135
137
|
|----------------------------------|-----------------------|
|
|
136
138
|
| Quality Assurance (QA) and Continuous Integration (CI): *The Software* is used to test or validate the products or services of the *Commercial Activity*, or to run their build and test pipelines | 0.3 |
|
|
137
139
|
| Products Completely Based on *The Software*: the products or services of the *Commercial Activity* are built completely on *The Software* | 0.5 |
|
|
138
140
|
|
|
139
141
|
### 5.6 Examples
|
|
140
|
-
A company earns 1,000,000,000 in *
|
|
142
|
+
A company earns 1,000,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
|
|
141
143
|
|
|
142
144
|
0.3 * 1,000,000,000 = 300,000,000
|
|
143
145
|
|
|
144
146
|
The *Derived Income* of 300,000,000 is more than 100,000,000 and not more than 1,000,000,000, so the *Usage Fee* for that *Fiscal Year* is 250,000.
|
|
145
147
|
|
|
146
|
-
A company earns 4,000,000 in *
|
|
148
|
+
A company earns 4,000,000 in *Gross Income* from a product during a *Fiscal Year*. The product is built completely on *The Software*, so the *Contribution Estimate* is 0.5.
|
|
147
149
|
|
|
148
150
|
0.5 * 4,000,000 = 2,000,000
|
|
149
151
|
|
|
150
152
|
The *Derived Income* of 2,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000.
|
|
151
153
|
|
|
152
|
-
A company earns 3,000,000 in *
|
|
154
|
+
A company earns 3,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
|
|
153
155
|
|
|
154
156
|
0.3 * 3,000,000 = 900,000
|
|
155
157
|
|
|
156
158
|
The *Derived Income* of 900,000 is 1,000,000 or less, so there is no *Usage Fee* for that *Fiscal Year*.
|
|
157
159
|
|
|
160
|
+
A company earns 50,000,000 in *Gross Income* from a line of medical devices during a *Fiscal Year*. The company uses *The Software* for the QA and CI of the devices, so the *Contribution Estimate* from the table is 0.3. The devices are not software, and the company reasonably estimates that their software accounts for one fifth (0.2) of the value of each shipped device, so the company reduces the *Contribution Estimate* to 0.06.
|
|
161
|
+
|
|
162
|
+
0.3 * 0.2 = 0.06
|
|
163
|
+
0.06 * 50,000,000 = 3,000,000
|
|
164
|
+
|
|
165
|
+
The *Derived Income* of 3,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000. Without the reduction, the *Derived Income* would be 15,000,000 and the *Usage Fee* would be 100,000.
|
|
166
|
+
|
|
158
167
|
### 5.7 Reporting and Payment
|
|
159
|
-
Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *
|
|
168
|
+
Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *Gross Income*, the *Contribution Estimate*, the reasoning used to make the *Contribution Estimate*, the *Derived Income*, and the *Usage Fee*. *Usage Fees* are payable in United States dollars. If any *Gross Income* is not counted under section 5.4, the statement must also identify each product or service that is in a *Migration Period* and show the dates of its *Migration Period*. No statement is required for a *Fiscal Year* in which no *Usage Fee* is owed.
|
|
160
169
|
|
|
161
170
|
### 5.8 Records and Review
|
|
162
|
-
*You* must keep records that reasonably support each *Contribution Estimate*, each *
|
|
171
|
+
*You* must keep records that reasonably support each *Contribution Estimate*, including any share used to reduce it under section 5.5, each *Gross Income* figure, and the dates of any *Migration Period* for at least three (3) years after the end of the *Fiscal Year* that they apply to. No more than once in any twelve (12) month period, *Licensor* may ask in writing for the records that support a statement, and *You* must provide them within sixty (60) days of the request. *Licensor* will treat those records as confidential.
|
|
163
172
|
|
|
164
173
|
### 5.9 Disputes About the Usage Fee
|
|
165
|
-
If *Licensor* believes that a *Contribution Estimate*, a *
|
|
174
|
+
If *Licensor* believes that a *Contribution Estimate*, a *Gross Income* figure, or the dates of a *Migration Period* are not reasonable, *Licensor* will notify *You* in writing and explain why. *You* and *Licensor* will then negotiate in good faith for at least sixty (60) days to agree on a reasonable *Usage Fee*. If *You* and *Licensor* cannot agree, either party may resolve the dispute as described in section 8.
|
|
166
175
|
|
|
167
176
|
### 5.10 Fixed License Cost
|
|
168
177
|
For assurance of costs, *You* may disclose to *Licensor* how *You* *Use* *The Software* and the returns that *You* estimate *You* will derive from it, and negotiate a fixed license cost with *Licensor*. A fixed license cost, and any other terms that *You* and *Licensor* agree to, must be set out in a writing signed by both *You* and *Licensor* (a **Fixed License Agreement**).
|
|
@@ -95,6 +95,12 @@ def command_testplus_testing_jobs_run(root, job, output, start, branch, build, f
|
|
|
95
95
|
:param root: Root directory used when scanning for tests.
|
|
96
96
|
:param job: Fully qualified job identifier.
|
|
97
97
|
:param output: Directory for test results.
|
|
98
|
+
:param start: Time stamp to associate with the start of the run.
|
|
99
|
+
:param branch: Branch name to associate with the results.
|
|
100
|
+
:param build: Build name to associate with the results.
|
|
101
|
+
:param flavor: Build flavor to associate with the results.
|
|
102
|
+
:param console_level: Logging level for console output.
|
|
103
|
+
:param logfile_level: Logging level for logfile output.
|
|
98
104
|
|
|
99
105
|
:returns: ``None``
|
|
100
106
|
"""
|
|
@@ -115,24 +121,45 @@ def command_testplus_testing_jobs_run(root, job, output, start, branch, build, f
|
|
|
115
121
|
|
|
116
122
|
# STEP 2 - Resolve the configuration variables (Performed by the root command)
|
|
117
123
|
|
|
118
|
-
|
|
124
|
+
from ccai.runtime.optionoverrides import AM_RUNTIME_OPTION_OVERRIDES
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
from ccai.testplus.cli.cmdtree.testing.options import parse_start_option
|
|
127
|
+
|
|
128
|
+
# STEP 3 - Apply any 'Configuration' related option overrides (this command has none)
|
|
129
|
+
|
|
130
|
+
# STEP 4 - Resolve the Configuration Maps (which maps are used comes from the configuration)
|
|
131
|
+
from ccai.configuration.configurationmaps import resolve_configuration_maps
|
|
132
|
+
resolve_configuration_maps()
|
|
121
133
|
|
|
122
|
-
# STEP 4 - Resolve the Configuration Maps
|
|
123
|
-
#from ccai.configuration.configurationmaps import resolve_configuration_maps
|
|
124
|
-
#resolve_configuration_maps(use_credentials=use_credentials, use_landscape=use_landscape,
|
|
125
|
-
# use_runtime=use_runtime, use_topology=use_topology)
|
|
126
|
-
|
|
127
134
|
# STEP 5 - The application of the remaining options must happen after we have resolved configuration
|
|
128
135
|
# maps because some of those settings will get overridden by the options. So the runtime
|
|
129
|
-
# needs to be loaded and set first before we apply runtime options
|
|
136
|
+
# needs to be loaded and set first before we apply runtime options
|
|
137
|
+
|
|
138
|
+
if branch is not None:
|
|
139
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_build_branch(branch)
|
|
140
|
+
|
|
141
|
+
if build is not None:
|
|
142
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_build_name(build)
|
|
143
|
+
|
|
144
|
+
if flavor is not None:
|
|
145
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_build_flavor(flavor)
|
|
146
|
+
|
|
147
|
+
if console_level is not None:
|
|
148
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_loglevel_console(console_level)
|
|
149
|
+
|
|
150
|
+
if logfile_level is not None:
|
|
151
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_loglevel_file(logfile_level)
|
|
152
|
+
|
|
153
|
+
if output is not None:
|
|
154
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_output_directory(output)
|
|
155
|
+
|
|
156
|
+
if start is not None:
|
|
157
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_starttime(parse_start_option(start))
|
|
130
158
|
|
|
131
|
-
# STEP 6 - Initialize the Results Output
|
|
159
|
+
# STEP 6 - Initialize the Results Output (performed below, after the root is validated; the process
|
|
160
|
+
# is activated as a test run by 'initialize_testplus_results', so it must not be activated here)
|
|
132
161
|
|
|
133
162
|
# STEP 7 - Create and kick off the job
|
|
134
|
-
from ccai.thisapp.activation import activate_profile_job, JobType
|
|
135
|
-
activate_profile_job(JobType.TestRun)
|
|
136
163
|
|
|
137
164
|
|
|
138
165
|
test_root = os.path.abspath(os.path.expandvars(os.path.expanduser(root)))
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: options
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Helpers shared by the ``testplus testing`` commands for converting option values.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__author__ = "Myron Walker"
|
|
10
|
+
__copyright__ = "Copyright 2026, Code Craft AI LLC"
|
|
11
|
+
__credits__ = []
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import re
|
|
16
|
+
|
|
17
|
+
from datetime import datetime
|
|
18
|
+
|
|
19
|
+
import click
|
|
20
|
+
|
|
21
|
+
from ccai.xmodules.xdatetime import DATETIME_FORMAT_FILESYSTEM, DATETIME_FORMAT_TIMESTAMP, parse_datetime
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
START_FORMATS = [DATETIME_FORMAT_TIMESTAMP, DATETIME_FORMAT_FILESYSTEM]
|
|
25
|
+
|
|
26
|
+
# 'date +%N' produces nanoseconds (9 digits) but '%f' only accepts up to 6 fractional digits.
|
|
27
|
+
REGEX_EXCESS_FRACTION = re.compile(r"^(.*\.[0-9]{6})[0-9]+$")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def parse_start_option(start: str) -> datetime:
|
|
31
|
+
"""
|
|
32
|
+
Parses the value of the '--start' option into a :class:`datetime`. The value is parsed with the same
|
|
33
|
+
timestamp and filesystem formats that are used to resolve the 'AM_STARTTIME' runtime variable. Fractional
|
|
34
|
+
seconds beyond microseconds (as produced by ``date +%N``) are truncated to microseconds.
|
|
35
|
+
|
|
36
|
+
:param start: The time stamp string passed to the '--start' option.
|
|
37
|
+
|
|
38
|
+
:returns: The start time as a :class:`datetime`.
|
|
39
|
+
:raises: click.BadParameter
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
starttime = None
|
|
43
|
+
|
|
44
|
+
candidate = start.strip()
|
|
45
|
+
mobj = REGEX_EXCESS_FRACTION.match(candidate)
|
|
46
|
+
if mobj is not None:
|
|
47
|
+
candidate = mobj.group(1)
|
|
48
|
+
|
|
49
|
+
for start_format in START_FORMATS:
|
|
50
|
+
try:
|
|
51
|
+
starttime = parse_datetime(candidate, datetime_format=start_format)
|
|
52
|
+
break
|
|
53
|
+
except ValueError:
|
|
54
|
+
continue
|
|
55
|
+
|
|
56
|
+
if starttime is None:
|
|
57
|
+
err_msg_lines = [
|
|
58
|
+
"The '--start' option value is not a valid time stamp.",
|
|
59
|
+
f" VALUE: {start}",
|
|
60
|
+
"EXPECTED FORMATS:",
|
|
61
|
+
]
|
|
62
|
+
for start_format in START_FORMATS:
|
|
63
|
+
err_msg_lines.append(f" {start_format}")
|
|
64
|
+
errmsg = os.linesep.join(err_msg_lines)
|
|
65
|
+
raise click.BadParameter(errmsg, param_hint="'--start'")
|
|
66
|
+
|
|
67
|
+
return starttime
|
|
@@ -67,6 +67,8 @@ from ccai.testplus.cli.cmdtree.testing.constants import (
|
|
|
67
67
|
CONFIGURATION_CHOICES
|
|
68
68
|
)
|
|
69
69
|
|
|
70
|
+
from ccai.testplus.cli.cmdtree.testing.options import parse_start_option
|
|
71
|
+
|
|
70
72
|
@click.command("run", help="Command used to run collections of tests.")
|
|
71
73
|
@click.option("--root", default=None, type=str, required=False, help=HELP_ROOT)
|
|
72
74
|
@click.option("--excludes", "-x", multiple=True, required=False, help=HELP_EXCLUDES)
|
|
@@ -285,7 +287,7 @@ def command_testplus_testing_run(root, includes, excludes, output, start, runid,
|
|
|
285
287
|
AM_RUNTIME_OPTION_OVERRIDES.override_output_directory(output)
|
|
286
288
|
|
|
287
289
|
if start is not None:
|
|
288
|
-
AM_RUNTIME_OPTION_OVERRIDES.override_starttime(start)
|
|
290
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_starttime(parse_start_option(start))
|
|
289
291
|
|
|
290
292
|
if runid is not None:
|
|
291
293
|
AM_RUNTIME_OPTION_OVERRIDES.override_run_id(runid)
|
|
@@ -13,7 +13,7 @@ __copyright__ = "Copyright 2025, Code Craft AI LLC"
|
|
|
13
13
|
__credits__ = []
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
from typing import Optional, Type
|
|
16
|
+
from typing import TYPE_CHECKING, Optional, Type
|
|
17
17
|
|
|
18
18
|
import argparse
|
|
19
19
|
import inspect
|
|
@@ -32,16 +32,21 @@ from ccai.thisapp.paths import get_path_for_testresults
|
|
|
32
32
|
from ccai.testbase.injection.injectionregistry import InjectionRegistry
|
|
33
33
|
from ccai.testbase.utilities import find_testmodule_root, find_testmodule_fullname
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
# NOTE: 'ccai.testplus.distributedtestjob' must not be imported at module level. Its import chain reaches the
|
|
36
|
+
# landscaping 'Landscape' class, whose class body needs the application persona, and a test module imports this
|
|
37
|
+
# module before 'distributed_test_entrypoint' has established the persona.
|
|
38
|
+
if TYPE_CHECKING:
|
|
39
|
+
from ccai.testplus.distributedtestjob import DistributedTestJob
|
|
36
40
|
|
|
37
41
|
|
|
38
|
-
def distributed_test_entrypoint(job_type: Optional[Type[DistributedTestJob]] =
|
|
42
|
+
def distributed_test_entrypoint(job_type: Optional[Type["DistributedTestJob"]] = None):
|
|
39
43
|
"""
|
|
40
44
|
This is the generic test entry point for test modules. It provides a standardized set of
|
|
41
45
|
commanline parameters that can be used to run test files as scripts.
|
|
42
46
|
|
|
43
47
|
:param job_type: The derived 'DistributedTestJob' type that is used to provide configuration information and
|
|
44
|
-
is used to execute the tests associated with this entrypoint.
|
|
48
|
+
is used to execute the tests associated with this entrypoint. When ``None`` (the default),
|
|
49
|
+
:class:`ccai.testplus.distributedtestjob.DefaultDistributedTestJob` is used.
|
|
45
50
|
|
|
46
51
|
.. note::
|
|
47
52
|
The `distributed_test_entrypoint` is a useful tool to place at the bottom of test files to allow them to easily
|
|
@@ -51,10 +56,21 @@ def distributed_test_entrypoint(job_type: Optional[Type[DistributedTestJob]] = D
|
|
|
51
56
|
from ccai.testplus.initialize import initialize_testplus_runtime, initialize_testplus_results
|
|
52
57
|
initialize_testplus_runtime()
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
if job_type is None:
|
|
60
|
+
from ccai.testplus.distributedtestjob import DefaultDistributedTestJob
|
|
61
|
+
job_type = DefaultDistributedTestJob
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
base_parser = argparse.ArgumentParser()
|
|
64
|
+
|
|
65
|
+
base_parser.add_argument("-i", "--include", dest="includes", action="append", default=[], help="Add an include search statement.")
|
|
66
|
+
base_parser.add_argument("-x", "--exclude", dest="excludes", action="append", default=[], help="Add an exclude filter statement.")
|
|
67
|
+
base_parser.add_argument("--console-level", dest="consolelevel", action="store", default=None, choices=LOG_LEVEL_NAMES, help="The logging level for console output.")
|
|
68
|
+
base_parser.add_argument("--logfile-level", dest="logfilelevel", action="store", default=None, choices=LOG_LEVEL_NAMES, help="The logging level for logfile output.")
|
|
69
|
+
|
|
70
|
+
# The arguments are parsed before logging is activated so the log levels given on the command line apply.
|
|
71
|
+
args = base_parser.parse_args()
|
|
72
|
+
|
|
73
|
+
from ccai.runtime.optionoverrides import AM_RUNTIME_OPTION_OVERRIDES
|
|
58
74
|
|
|
59
75
|
# Test job types that inherit from 'DistributedTestJob' can set the requires_credentials, requires_landscape, requires_topology,
|
|
60
76
|
# and requires_runtime to indicate that the test framework must load the appropriate configuration maps.
|
|
@@ -62,7 +78,14 @@ def distributed_test_entrypoint(job_type: Optional[Type[DistributedTestJob]] = D
|
|
|
62
78
|
resolve_configuration_maps(use_credentials=job_type.requires_credentials, use_landscape=job_type.requires_landscape,
|
|
63
79
|
use_runtime=job_type.requires_runtime, use_topology=job_type.requires_topology)
|
|
64
80
|
|
|
65
|
-
|
|
81
|
+
if args.consolelevel is not None:
|
|
82
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_loglevel_console(args.consolelevel)
|
|
83
|
+
|
|
84
|
+
if args.logfilelevel is not None:
|
|
85
|
+
AM_RUNTIME_OPTION_OVERRIDES.override_loglevel_file(args.logfilelevel)
|
|
86
|
+
|
|
87
|
+
# Initialize test results and also logging; this activates the process as a test run, so the
|
|
88
|
+
# profile must not be activated anywhere else.
|
|
66
89
|
initialize_testplus_results()
|
|
67
90
|
|
|
68
91
|
logger = getEnhancedLogger()
|
|
@@ -70,13 +93,6 @@ def distributed_test_entrypoint(job_type: Optional[Type[DistributedTestJob]] = D
|
|
|
70
93
|
# We must exit with a result code, initialize it to 0 here
|
|
71
94
|
result_code = 0
|
|
72
95
|
|
|
73
|
-
base_parser = argparse.ArgumentParser()
|
|
74
|
-
|
|
75
|
-
base_parser.add_argument("-i", "--include", dest="includes", action="append", default=[], help="Add an include search statement.")
|
|
76
|
-
base_parser.add_argument("-x", "--exclude", dest="excludes", action="append", default=[], help="Add an exclude filter statement.")
|
|
77
|
-
base_parser.add_argument("--console-level", dest="consolelevel", action="store", default="INFO", choices=LOG_LEVEL_NAMES, help="The logging level for console output.")
|
|
78
|
-
base_parser.add_argument("--logfile-level", dest="logfilelevel", action="store", default="DEBUG", choices=LOG_LEVEL_NAMES, help="The logging level for logfile output.")
|
|
79
|
-
|
|
80
96
|
test_module = sys.modules["__main__"]
|
|
81
97
|
|
|
82
98
|
this_app = ThisApplicationSingleton()
|
|
@@ -127,8 +143,6 @@ def distributed_test_entrypoint(job_type: Optional[Type[DistributedTestJob]] = D
|
|
|
127
143
|
resource_registry = InjectionRegistry()
|
|
128
144
|
resource_registry.rename_resource_origins_from_main(module_fullname)
|
|
129
145
|
|
|
130
|
-
args = base_parser.parse_args()
|
|
131
|
-
|
|
132
146
|
includes = args.includes
|
|
133
147
|
excludes = args.excludes
|
|
134
148
|
if len(includes) == 0:
|
|
File without changes
|
{codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codecraftai_testplus-1.2.2 → codecraftai_testplus-1.3.0}/source/packages/ccai/testplus/py.typed
RENAMED
|
File without changes
|