Skip to content

Namespace tests as test/schemas - #126

Merged
jviotti merged 1 commit into
mainfrom
namespace-tests
Aug 4, 2026
Merged

Namespace tests as test/schemas#126
jviotti merged 1 commit into
mainfrom
namespace-tests

Conversation

@jviotti

@jviotti jviotti commented Aug 4, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

6 issues found across 2402 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/schemas/bipm/si/2019/compound/joule-second/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/compound/joule-second/v1.test.json:15">
P3: The suite never tests zero or negative values, so the schema's only numeric constraint (exclusiveMinimum: 0) is entirely uncovered. Add cases asserting 0 and a negative number are invalid so the boundary of the constraint is actually verified.</violation>
</file>

<file name="test/schemas/bipm/si/2019/base/quantity/length/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/base/quantity/length/v1.test.json:11">
P3: The length schema constrains `type: number` with `minimum: 0`, but this test never exercises that boundary: there is no zero case and no negative value asserting `valid: false`. The sibling attometre test for the same schema shape covers both; adding a 0 (valid) and a negative (invalid) case would guard against regressions of the minimum constraint.</violation>
</file>

<file name="test/schemas/bipm/si/2019/base/quantity/amount-of-substance/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/base/quantity/amount-of-substance/v1.test.json:5">
P3: The tests only cover JSON value types and never exercise the schema's distinguishing keyword "exclusiveMinimum": 0. Adding cases where data is 0 and -1 (expecting valid: false) would catch a future regression that silently drops the positive-only constraint, which the otherwise-identical electric-current tests (no numeric bound) would not detect.</violation>
</file>

<file name="test/schemas/bipm/si/2019/base/quantity/mass/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/base/quantity/mass/v1.test.json:11">
P3: The schema enforces `minimum: 0`, but the test cases never exercise that constraint: there is no valid `0` case and no invalid negative-number case. The sibling `prefixed/gram/v1.test.json` explicitly covers both (`data: 0` valid, `data: -50` invalid), so adding equivalent boundary cases here would close the coverage gap for the `minimum` keyword.</violation>
</file>

<file name="test/schemas/bipm/si/2019/compound/lumen-per-watt/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/compound/lumen-per-watt/v1.test.json:16">
P3: Test data omits boundary coverage for the schema's `exclusiveMinimum: 0` constraint: 0 and negative numbers are invalid but never tested. Add cases for `0` and a negative value, matching the pattern used in sibling files such as `test/schemas/bipm/si/2019/base/prefixed/attogram/v1.test.json` which includes an "Invalid - negative" case.</violation>
</file>

<file name="test/schemas/bipm/si/2019/base/quantity/time/v1.test.json">

<violation number="1" location="test/schemas/bipm/si/2019/base/quantity/time/v1.test.json:6">
P3: The time schema enforces `minimum: 0`, but this test suite never exercises that constraint — all `valid: true` cases are positive, so removing `minimum: 0` would not fail these tests. Consider adding a 'Valid - zero' case (data: 0) and an 'Invalid - negative' case (e.g. data: -1, valid: false), matching the sibling attosecond test convention.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 200 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.

Re-trigger cubic

"valid": true
},
{
"description": "Valid - small positive",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The suite never tests zero or negative values, so the schema's only numeric constraint (exclusiveMinimum: 0) is entirely uncovered. Add cases asserting 0 and a negative number are invalid so the boundary of the constraint is actually verified.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/compound/joule-second/v1.test.json, line 15:

<comment>The suite never tests zero or negative values, so the schema's only numeric constraint (exclusiveMinimum: 0) is entirely uncovered. Add cases asserting 0 and a negative number are invalid so the boundary of the constraint is actually verified.</comment>

<file context>
@@ -0,0 +1,45 @@
+      "valid": true
+    },
+    {
+      "description": "Valid - small positive",
+      "data": 0.001,
+      "valid": true
</file context>

},
{
"description": "Valid - decimal",
"data": 5.5,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The length schema constrains type: number with minimum: 0, but this test never exercises that boundary: there is no zero case and no negative value asserting valid: false. The sibling attometre test for the same schema shape covers both; adding a 0 (valid) and a negative (invalid) case would guard against regressions of the minimum constraint.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/base/quantity/length/v1.test.json, line 11:

<comment>The length schema constrains `type: number` with `minimum: 0`, but this test never exercises that boundary: there is no zero case and no negative value asserting `valid: false`. The sibling attometre test for the same schema shape covers both; adding a 0 (valid) and a negative (invalid) case would guard against regressions of the minimum constraint.</comment>

<file context>
@@ -0,0 +1,40 @@
+    },
+    {
+      "description": "Valid - decimal",
+      "data": 5.5,
+      "valid": true
+    },
</file context>

"target": "../../../../../../../../schemas/bipm/si/2019/base/quantity/amount-of-substance/v1.json",
"tests": [
{
"description": "Valid - positive number",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The tests only cover JSON value types and never exercise the schema's distinguishing keyword "exclusiveMinimum": 0. Adding cases where data is 0 and -1 (expecting valid: false) would catch a future regression that silently drops the positive-only constraint, which the otherwise-identical electric-current tests (no numeric bound) would not detect.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/base/quantity/amount-of-substance/v1.test.json, line 5:

<comment>The tests only cover JSON value types and never exercise the schema's distinguishing keyword "exclusiveMinimum": 0. Adding cases where data is 0 and -1 (expecting valid: false) would catch a future regression that silently drops the positive-only constraint, which the otherwise-identical electric-current tests (no numeric bound) would not detect.</comment>

<file context>
@@ -0,0 +1,40 @@
+  "target": "../../../../../../../../schemas/bipm/si/2019/base/quantity/amount-of-substance/v1.json",
+  "tests": [
+    {
+      "description": "Valid - positive number",
+      "data": 10,
+      "valid": true
</file context>

},
{
"description": "Valid - decimal",
"data": 5.5,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The schema enforces minimum: 0, but the test cases never exercise that constraint: there is no valid 0 case and no invalid negative-number case. The sibling prefixed/gram/v1.test.json explicitly covers both (data: 0 valid, data: -50 invalid), so adding equivalent boundary cases here would close the coverage gap for the minimum keyword.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/base/quantity/mass/v1.test.json, line 11:

<comment>The schema enforces `minimum: 0`, but the test cases never exercise that constraint: there is no valid `0` case and no invalid negative-number case. The sibling `prefixed/gram/v1.test.json` explicitly covers both (`data: 0` valid, `data: -50` invalid), so adding equivalent boundary cases here would close the coverage gap for the `minimum` keyword.</comment>

<file context>
@@ -0,0 +1,40 @@
+    },
+    {
+      "description": "Valid - decimal",
+      "data": 5.5,
+      "valid": true
+    },
</file context>

},
{
"description": "Valid - small positive",
"data": 0.001,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Test data omits boundary coverage for the schema's exclusiveMinimum: 0 constraint: 0 and negative numbers are invalid but never tested. Add cases for 0 and a negative value, matching the pattern used in sibling files such as test/schemas/bipm/si/2019/base/prefixed/attogram/v1.test.json which includes an "Invalid - negative" case.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/compound/lumen-per-watt/v1.test.json, line 16:

<comment>Test data omits boundary coverage for the schema's `exclusiveMinimum: 0` constraint: 0 and negative numbers are invalid but never tested. Add cases for `0` and a negative value, matching the pattern used in sibling files such as `test/schemas/bipm/si/2019/base/prefixed/attogram/v1.test.json` which includes an "Invalid - negative" case.</comment>

<file context>
@@ -0,0 +1,45 @@
+    },
+    {
+      "description": "Valid - small positive",
+      "data": 0.001,
+      "valid": true
+    },
</file context>

"tests": [
{
"description": "Valid - positive number",
"data": 10,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The time schema enforces minimum: 0, but this test suite never exercises that constraint — all valid: true cases are positive, so removing minimum: 0 would not fail these tests. Consider adding a 'Valid - zero' case (data: 0) and an 'Invalid - negative' case (e.g. data: -1, valid: false), matching the sibling attosecond test convention.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/schemas/bipm/si/2019/base/quantity/time/v1.test.json, line 6:

<comment>The time schema enforces `minimum: 0`, but this test suite never exercises that constraint — all `valid: true` cases are positive, so removing `minimum: 0` would not fail these tests. Consider adding a 'Valid - zero' case (data: 0) and an 'Invalid - negative' case (e.g. data: -1, valid: false), matching the sibling attosecond test convention.</comment>

<file context>
@@ -0,0 +1,40 @@
+  "tests": [
+    {
+      "description": "Valid - positive number",
+      "data": 10,
+      "valid": true
+    },
</file context>

@jviotti
jviotti merged commit 72d19a2 into main Aug 4, 2026
3 checks passed
@jviotti
jviotti deleted the namespace-tests branch August 4, 2026 23:08
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.

1 participant