Skip to content
Snippets Groups Projects
Unverified Commit 027776ee authored by Yee's avatar Yee Committed by GitHub
Browse files

Store nullable data in a separate csv file (#847)

* Increase wait time for index tests

* Move nullable csv data to another file

* Combine query lines

* Use gherkin reporter

* Restore gherkin reporter since not compatible with xdist plugin
parent 0766f2b2
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,22 @@ schema: |
CREATE TAG INDEX IF NOT EXISTS bachelor_index ON bachelor();
CREATE EDGE INDEX IF NOT EXISTS serve_start_end_index ON serve(start_year, end_year);
files:
- path: ./null.csv
withHeader: true
type: vertex
vertex:
vid:
index: 0
type: string
tags:
- name: player
props:
- name: name
type: string
index: 1
- name: age
type: int
index: 2
- path: ./player.csv
withHeader: true
type: vertex
......
:VID(string),player.name:string,player.age:int
Null1,null,-1
Null2,Null,-2
Null3,NULL,-3
Null4,__NULL__,-4
......@@ -51,7 +51,3 @@ Grant Hill,Grant Hill,46
Shaquile O'Neal,Shaquile O'Neal,47
JaVale McGee,JaVale McGee,31
Dwight Howard,Dwight Howard,33
Null1,null,-1
Null2,Null,-2
Null3,NULL,-3
Null4,__NULL__,-4
......@@ -8,6 +8,7 @@ import time
from tests.common.nebula_test_suite import NebulaTestSuite
class TestSimpleQuery(NebulaTestSuite):
@classmethod
def prepare(self):
resp = self.execute(
......
......@@ -8,7 +8,9 @@ import time
from tests.common.nebula_test_suite import NebulaTestSuite
class TestIndex(NebulaTestSuite):
@classmethod
def prepare(self):
resp = self.execute(
......@@ -102,7 +104,6 @@ class TestIndex(NebulaTestSuite):
resp = self.execute('INSERT VERTEX team(name) VALUES "204":("opl")')
self.check_resp_succeeded(resp)
def test_edge_index(self):
resp = self.execute('LOOKUP ON serve where serve.start_year > 0')
self.check_resp_succeeded(resp)
......
......@@ -42,6 +42,10 @@ def normalize_outline_scenario(request, name):
return name
def combine_query(query: str) -> str:
return " ".join(line.strip() for line in query.splitlines())
@pytest.fixture
def graph_spaces():
return dict(result_set=None)
......@@ -77,7 +81,7 @@ def empty_graph(session, graph_spaces):
@given(parse("having executed:\n{query}"))
def having_executed(query, session, request):
ngql = " ".join(query.splitlines())
ngql = combine_query(query)
ngql = normalize_outline_scenario(request, ngql)
response(session, ngql)
......@@ -125,13 +129,13 @@ def exec_query(request, ngql, session, graph_spaces):
@when(parse("executing query:\n{query}"))
def executing_query(query, graph_spaces, session, request):
ngql = " ".join(query.splitlines())
ngql = combine_query(query)
exec_query(request, ngql, session, graph_spaces)
@when(parse("profiling query:\n{query}"))
def profiling_query(query, graph_spaces, session, request):
ngql = "PROFILE {" + " ".join(query.splitlines()) + "}"
ngql = "PROFILE {" + combine_query(query) + "}"
exec_query(request, ngql, session, graph_spaces)
......
......@@ -3,7 +3,7 @@ Feature: Lookup by index itself
Background:
Given an empty graph
And load "nba" csv data to a new space
And wait 3 seconds
And wait 6 seconds
Scenario: [1] tag index
When executing query:
......
......@@ -3,7 +3,7 @@ Feature: Lookup by index itself in integer vid
Background:
Given an empty graph
And load "nba_int_vid" csv data to a new space
And wait 3 seconds
And wait 6 seconds
Scenario: [1] tag index
When executing query:
......
......@@ -21,7 +21,7 @@ Feature: Update int vid of vertex and edge
CREATE EDGE IF NOT EXISTS select(grade int, year int);
CREATE EDGE IF NOT EXISTS select_default(grade int NOT NULL,year TIMESTAMP DEFAULT 1546308000);
"""
And wait 3 seconds
And wait 6 seconds
Scenario: update and upsert test
When executing query:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment