- Pre-requisites: TigerGraph, python3
- load utility functions, this provide utility functions
. setup/util.sh
- Set up the schema, and load data.
Catalog, loading_job tests does not require the data to be loaded
setup/setup.sh
setup/setup.sh -nodata
- Use the driver to
- Run any category of tests
./driver.py catalog ./driver.py read_query ./driver.py accumClause
- Single gsql file
./drivery userRole/userToken.sh ./driver.py setAccum1.gsql ./driver.py accumClause/setAccum1.gsql
- Run any category of tests
- The above two steps is equivalent to
gdriver [test] --setup
Other usages of ./driver.py
--skip
or-s
to skip query parse and compile, only run queries and compare.--mode [mode]
or-m [mode]
to run queries in a specified mode.--info
or-i
info mode, print results to terminal (default write tooutput/
folder).
For example, I use ./driver.py vSetAssign1 -sim udf
to debug single query or test.
- Query tests are in
test_case/read_query
(Read-Only query, no data modification) andtest_case/write_query
. - During the test, the driver will goes to the parent folder of GSQL files. The parent folder name must be unique. The query name must use format
[parent folder]_[query Name][Number]
so that the query name does not collide with each other. - Secondary extensions
udf
,single
ordist
can be used to make query to be installed in a certain mode. Files with a single extensiongsql
are installed in all three modes. The GSQL script to invoke query ends with.run
. The output is.out
and the baseline is.base
. JSON outputs are sorted and formated before writing to.out
files, the.out
file should be exactly the same as the baseline file. - Utility function
check_stat
can check the data statistics. The data set has dominant number ofComment
vertices. Writing queries onComment
vertices require preformance consideration. - Length of each print statment is recommended to be less than 500. Please use attribute
creationDate
orcreationEpoch
to filter vertices. The creation date for LDBC SNB data is nearly uniformly distributed between 2010-01-01 and 2013-01-01. For example, you can create a query as below and tune the parameter values to get the output length in a seasonale length. You can use./driver.py [test folder]/[query_name].gsql -sim udf
to print results in terminal and tune the output length. To finish use use./driver.py [test folder]/[query_name].gsql -sum udf
to update the baselines.CREATE OR REPLACE QUERY q (datetime date) { S = SELECT s FROM tuplePerson:s WHERE s.creationDate < to_datetime(date) } RUN QUERY q("2010-01-02")
- GSQL files should include comments to address
- The tested functionality or documentation link
- The discovered or tested bug and ticket number
- The shell tests can print Tags
[GTEST_IB]
,[GTEST_IE]
and[GTEST_IL]
. The output is dumped to.log
file first. Then the files is processed bygclean file.log > file.out
. The contents between[GTEST_IB]
and[GTEST_IE]
are removed and the lines beginning withGTEST_IL
are removed. - The json output in shells can be sorted using
sort_json
function.
The following utility functions will be available after source setup/util.sh
- Utility functions for navitation
cdregress
- go the regress home folderregress
cdtc
- go toregress/test_case
cdsetup
- go toregress/setup
cddata
- go to the LDBC data setregress/setup/ldbc_snb_data-sf0.1/social_network
- Utility functions for processing the Log
sort_json
- Sort json output, for exmpleecho '{"error":false, "results":[{"key":1}]}' | sort_json
gclean
- Remove contents between[GTEST_IB]
and[GTEST_IE]
and remove lines starting with[GTEST_IL]
- Utility functions for running tests
ggsql
is equivalent togsql -g test_graph
gdriver
call the./driver.py
- Utility for test design
check_stat
- print the statistics for the data, can be used withcheck_stat | sort_json
echoTitle
andechoNegative
- print formatted headers for postive and negative cases, respectively.