-
Notifications
You must be signed in to change notification settings - Fork 85
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
Testing framework v2 #1548
Testing framework v2 #1548
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1548 +/- ##
==========================================
+ Coverage 91.71% 91.73% +0.01%
==========================================
Files 695 695
Lines 25031 25033 +2
==========================================
+ Hits 22957 22963 +6
+ Misses 2074 2070 -4
☔ 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.
One general comment is that we'd better differentiate test case names for different test files. For example, tests under tinysnb/function
can be named as ArithmeticFunction
, BooleanFunction
, etc., instead of just as Function
for all of them.
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.
LGTM!
One general comment is that we'd better differentiate test case names for different test files. For example, tests under tinysnb/function
can be named as ArithmeticFunction
, BooleanFunction
, etc., instead of just as Function
for all of them.
Sounds good! I added to the issue TODO list and I'll change it in the next PR. |
test/include/test_runner/test_case.h
Outdated
|
||
#include "main/kuzu.h" | ||
|
||
using namespace kuzu::main; |
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.
Remove using namespace kuzu::main;
. Our convention is that we never use using namespace
in header files, but you can use them in cpp files. In header files, we add the namespace prefix as needed.
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.
Should I do the same with test_helper.h
as well (we're gonna drop test_helper soon)?
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.
Up to you. Just keep a note is fine.
#include "planner/planner.h" | ||
#include "test_runner/test_case.h" | ||
|
||
using namespace kuzu::planner; |
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.
Ditto. Remove using namespace kuzu::planner;
here.
Supports multiple statements, statement blocks, exceptions
Testing Framework v2
The new framework uses the following logic:
e2e_read_test
scans a directory or opens a specific test file if it's passed as an argument. After we supportwrite
operation, we should change this name.TestCase
is created for each.test
file.TestParser
is responsible for reading and tokenizing the test fileTestCase
usesTestParser
to check the tokens (STATEMENT, CHECK_ORDER, GROUP etc)TestCase
object is created containing a vector ofTestStatement
.TestStatement
is a struct (derived fromTestQueryConfig
) containing the information about that statement..group
file anymore. The .test file must contain a header with the following information:-GROUP
,-DATASET
and-TEST
.TestCase
is created,e2e_read_test
will register to GTest.TestRunner
will be responsible to run the test. It reads theTestCase
, prepare the logical plans and executes.TestRunner
will check if the result corresponds to the expected in the statement.This is still a work in progress. It currently supports multiple statements, exceptions and statement blocks.
TODO
.test
files to the current formatfour_hop.test
andfive_hop.test
)Related to #1521