Skip to content
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

Support asserting RETURN result column names in testing framework #3417

Merged
merged 8 commits into from
May 2, 2024

Conversation

yiyun-sj
Copy link
Contributor

@yiyun-sj yiyun-sj commented Apr 30, 2024

Column Name Assertion

  • added new optional property to check for column names -CHECK_COLUMN_NAMES
  • column names form a tuple in the first row of tuples (need to +1 tuple count)
  • the same behaviour applies to csv answers and hash compare (column names treated as a tuple)
  • if checking order, column names always first in result order

Example

-CHECK_COLUMN_NAMES
-STATEMENT MATCH (a:User) RETURN a.name, COUNT { MATCH (a)<-[:Follows]-(b:User) } AS num_follower ORDER BY num_follower;
---- 5
a.name|num_follower
Adam|0
Karissa|1
Noura|1
Zhang|2

@yiyun-sj yiyun-sj linked an issue Apr 30, 2024 that may be closed by this pull request
@yiyun-sj yiyun-sj marked this pull request as ready for review May 1, 2024 17:15
@yiyun-sj yiyun-sj requested a review from ray6080 May 1, 2024 17:15
Copy link
Contributor

@ray6080 ray6080 left a comment

Choose a reason for hiding this comment

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

LGTM! Can u add a test case for this feature?

@yiyun-sj
Copy link
Contributor Author

yiyun-sj commented May 2, 2024

LGTM! Can u add a test case for this feature?

Added a test case for basic usage. Let me know if I should add tests for CSV answers and hashing as well.

Noura|25
Adam|30
Karissa|40
Zhang|50
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a new line here.

@yiyun-sj yiyun-sj merged commit 08df7d7 into master May 2, 2024
17 checks passed
@yiyun-sj yiyun-sj deleted the test-column-name branch May 2, 2024 22:13
ted-wq-x pushed a commit to ted-wq-x/kuzu that referenced this pull request Nov 14, 2024
…zudb#3417)

* preliminary implementation of column name assertion

* change column name format

* Run clang-format

* support FILE answers for column names

* change interaction to include hash compare

* Run clang-format

* add example test case

* add newline

---------

Co-authored-by: s32jia <[email protected]>
Co-authored-by: CI Bot <[email protected]>
(cherry picked from commit 08df7d7)
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.

Testing framework improvement
2 participants