-
Notifications
You must be signed in to change notification settings - Fork 56
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
Extend unit tests #1967
base: main
Are you sure you want to change the base?
Extend unit tests #1967
Conversation
This is pretty cool. If you can isolate changes to onnxscript/ir in a separate PR that’d be great |
type_constraint = deduce_type_constraints.TypeConstraint("test_constraint", {"tensor(float)", "tensor(int64)"}) | ||
type_constraint.bind_value(value1) | ||
type_constraint.bind_value(value2) | ||
expected_repr = "TypeConstraint(name=test_constraint, type_strs={'tensor(float)', 'tensor(int64)'}, values=['value1', 'value2'])" |
Check notice
Code scanning / CodeQL
Unused local variable Note
graph.register_initializer(unnamed_initializer) | ||
|
||
# Attempt to register an initializer that is produced by a node | ||
node = ir.Node(domain="", op_type="Add", inputs=[], outputs=[initializer]) |
Check notice
Code scanning / CodeQL
Unused local variable Note
type_constraints = {} | ||
parameter = _schemas._convert_formal_parameter(mock_param, type_constraints) | ||
self.assertEqual(parameter.name, "param") | ||
self.assertTrue(ir.TensorType(ir.DataType.FLOAT) in parameter.type_constraint.allowed_types) |
Check notice
Code scanning / CodeQL
Imprecise assert Note
def match_pattern(op, x): | ||
return op.Add(x, x) | ||
|
||
def apply_pattern(op, x, **_): |
Check notice
Code scanning / CodeQL
Unused local variable Note
@@ -4,6 +4,11 @@ | |||
|
|||
import onnxscript.tools.benchmark.benchmark_helpers as bh | |||
|
|||
import torch |
Check notice
Code scanning / CodeQL
Unused import Note test
@@ -4,6 +4,11 @@ | |||
|
|||
import onnxscript.tools.benchmark.benchmark_helpers as bh | |||
|
|||
import torch | |||
import onnx |
Check notice
Code scanning / CodeQL
Unused import Note test
def test_class_getitem_shape_already_specified(self): | ||
from onnxscript.onnx_types import FLOAT | ||
with self.assertRaises(ValueError): | ||
FLOAT[None][None] |
Check notice
Code scanning / CodeQL
Statement has no effect Note test
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1967 +/- ##
==========================================
+ Coverage 75.13% 77.04% +1.90%
==========================================
Files 265 265
Lines 28907 30164 +1257
Branches 3331 3336 +5
==========================================
+ Hits 21720 23239 +1519
+ Misses 6158 5903 -255
+ Partials 1029 1022 -7 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Hi, I used cover-agent to write the tests for this PR. It uses an AI-based workflow to add new test cases that increase code coverage.
All AI-generated tests have met these four essential criteria:
Increased Coverage
Why adding unit tests is important
Writing and maintaining unit tests can be tedious, especially as codebases grow larger
Despite this challenge, unit tests provide key benefits:
Tests serve as executable documentation by: