-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert demo db tests to e2e tests (#1574)
- Loading branch information
Showing
16 changed files
with
501 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
-GROUP DemoDBCreateTest | ||
-DATASET demo-db/csv | ||
|
||
-- | ||
|
||
-CASE CreateNodeTest1 | ||
-STATEMENT CREATE (u:User {name: 'Alice', age: 35}) | ||
---- ok | ||
-QUERY MATCH (a:User) WHERE a.name = 'Alice' RETURN a.name, a.age | ||
---- 1 | ||
Alice|35 | ||
|
||
-CASE CreateNodeTest2 | ||
-STATEMENT CREATE (u:User {name: 'Dimitri'}) | ||
---- ok | ||
-QUERY MATCH (a:User) WHERE a.name = 'Dimitri' RETURN a.name, a.age | ||
---- 1 | ||
Dimitri| | ||
|
||
-CASE CreateRelTest1 | ||
-STATEMENT CREATE (u:User {name: 'Alice'}) | ||
---- ok | ||
-STATEMENT MATCH (a:User) WHERE a.name = 'Adam' WITH a MATCH (b:User) WHERE b.name = 'Alice' WITH a, b CREATE (a)-[e:Follows {since:1990}]->(b) | ||
---- ok | ||
-CHECK_ORDER | ||
-QUERY MATCH (a:User)-[:Follows]->(b:User) WHERE a.name = 'Adam' RETURN b.name ORDER BY b.name | ||
---- 3 | ||
Alice | ||
Karissa | ||
Zhang | ||
|
||
-CASE CreateRelTest2 | ||
-STATEMENT MATCH (a:User), (b:User) WHERE a.name='Zhang' AND b.name='Karissa' CREATE (a)-[:Follows {since:2022}]->(b) | ||
---- ok | ||
-CHECK_ORDER | ||
-QUERY MATCH (a:User)-[:Follows]->(b:User) WHERE a.name = 'Zhang' RETURN b.name ORDER BY b.name | ||
---- 2 | ||
Karissa | ||
Noura | ||
|
||
-CASE CreateAvgNullTest | ||
-STATEMENT MATCH (a:User) WHERE a.name = 'Adam' CREATE (a)-[:Follows]->(b:User {name:'Alice'}) | ||
---- ok | ||
-CHECK_ORDER | ||
-QUERY MATCH (a:User) WITH a, avg(a.age) AS b, SUM(a.age) AS c, COUNT(a.age) AS d, COUNT(*) AS e RETURN a, b, c,d, e ORDER BY c DESC | ||
---- 5 | ||
(label:User, 0:4, {name:Alice, age:})|||0|1 | ||
(label:User, 0:2, {name:Zhang, age:50})|50.000000|50|1|1 | ||
(label:User, 0:1, {name:Karissa, age:40})|40.000000|40|1|1 | ||
(label:User, 0:0, {name:Adam, age:30})|30.000000|30|1|1 | ||
(label:User, 0:3, {name:Noura, age:25})|25.000000|25|1|1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-GROUP DemoDBDeleteTest | ||
-DATASET demo-db/csv | ||
|
||
-- | ||
|
||
-CASE DeleteNodeTest | ||
-STATEMENT CREATE (u:User {name: 'Alice', age: 35}) | ||
---- ok | ||
-QUERY MATCH (u:User) RETURN COUNT(*) | ||
---- 1 | ||
5 | ||
-STATEMENT MATCH (u:User) WHERE u.name = 'Alice' DELETE u | ||
---- ok | ||
-QUERY MATCH (u:User) RETURN COUNT(*) | ||
---- 1 | ||
4 | ||
|
||
-CASE DeleteRelTest | ||
-STATEMENT MATCH (u:User)-[f:Follows]->(u1:User) WHERE u.name = 'Adam' AND u1.name = 'Karissa' DELETE f | ||
---- ok | ||
-QUERY MATCH (u:User)-[f:Follows]->(u1:User) WHERE u.name='Adam' RETURN u1.name | ||
---- 1 | ||
Zhang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-GROUP DemoDBTest | ||
-DATASET demo-db/parquet | ||
|
||
-- | ||
|
||
-CASE DemoDBOrderedTestFromParquet | ||
|
||
-NAME OrderBy1 | ||
-CHECK_ORDER | ||
-QUERY MATCH (u:User) RETURN u.name, u.age ORDER BY u.age; | ||
---- 4 | ||
Noura|25 | ||
Adam|30 | ||
Karissa|40 | ||
Zhang|50 | ||
|
||
-NAME OrderBy2 | ||
-CHECK_ORDER | ||
-QUERY MATCH (u:User)-[:LivesIn]->(c:City) WHERE c.name = "Waterloo" RETURN u.name, u.age ORDER BY u.age DESC; | ||
---- 2 | ||
Karissa|40 | ||
Adam|30 | ||
|
||
-NAME OrderBy3 | ||
-CHECK_ORDER | ||
-QUERY MATCH (a:User)-[:Follows]->(b:User) RETURN b.age, a.name ORDER BY b.age DESC, a.name DESC; | ||
---- 4 | ||
50|Karissa | ||
50|Adam | ||
40|Adam | ||
25|Zhang |
Oops, something went wrong.