Skip to content

Commit

Permalink
Merge branch 'master' into clean-flowtest
Browse files Browse the repository at this point in the history
  • Loading branch information
swilly22 committed Feb 14, 2024
2 parents 213e152 + b65e5c6 commit f81c5ef
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
# network=host driver-opt needed to push to local registry
driver-opts: network=host
Expand Down
2 changes: 1 addition & 1 deletion deps/libcypher-parser/lib/src/ast_foreach.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct foreach_clause
const cypher_astnode_t *identifier;
const cypher_astnode_t *expression;
unsigned int nclauses;
const cypher_astnode_t *clauses[];
cypher_astnode_t *clauses[];
};


Expand Down
4 changes: 2 additions & 2 deletions deps/libcypher-parser/lib/src/ast_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct query
unsigned int noptions;
const cypher_astnode_t **options;
unsigned int nclauses;
const cypher_astnode_t *clauses[];
cypher_astnode_t *clauses[];
};


Expand Down Expand Up @@ -219,7 +219,7 @@ ssize_t detailstr(const cypher_astnode_t *self, char *str, size_t size)
size_t n = 8;

ssize_t r = snprint_sequence(str + 8, (size > 8)? size-8 : 0,
node->clauses, node->nclauses);
(const cypher_astnode_t * const *)node->clauses, node->nclauses);
if (r < 0)
{
return -1;
Expand Down
6 changes: 3 additions & 3 deletions deps/libcypher-parser/lib/src/ast_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
struct statement
{
cypher_astnode_t _astnode;
const cypher_astnode_t *body;
cypher_astnode_t *body;
unsigned int noptions;
const cypher_astnode_t *options[];
};
Expand All @@ -41,7 +41,7 @@ const struct cypher_astnode_vt cypher_statement_astnode_vt =


cypher_astnode_t *cypher_ast_statement(cypher_astnode_t * const *options,
unsigned int noptions, const cypher_astnode_t *body,
unsigned int noptions, cypher_astnode_t *body,
cypher_astnode_t **children, unsigned int nchildren,
struct cypher_input_range range)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ cypher_astnode_t *cypher_ast_statement(cypher_astnode_t * const *options,
void cypher_ast_statement_replace_body
(
cypher_astnode_t *astnode,
const cypher_astnode_t *body
cypher_astnode_t *body
)
{
REQUIRE_TYPE(astnode, CYPHER_AST_STATEMENT, NULL);
Expand Down
4 changes: 2 additions & 2 deletions deps/libcypher-parser/lib/src/cypher-parser.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ enum cypher_rel_direction
*/
__cypherlang_must_check
cypher_astnode_t *cypher_ast_statement(cypher_astnode_t * const *options,
unsigned int noptions, const cypher_astnode_t *body,
unsigned int noptions, cypher_astnode_t *body,
cypher_astnode_t **children, unsigned int nchildren,
struct cypher_input_range range);

Expand All @@ -550,7 +550,7 @@ cypher_astnode_t *cypher_ast_statement(cypher_astnode_t * const *options,
* @return A `CYPHER_AST_QUERY` or `CYPHER_AST_SCHEMA_COMMAND` node.
*/
void cypher_ast_statement_replace_body(cypher_astnode_t *astnode,
const cypher_astnode_t *body);
cypher_astnode_t *body);

/**
* Get the number of options in a `CYPHER_AST_STATEMENT` node.
Expand Down
6 changes: 0 additions & 6 deletions tests/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ def _warning_formater(message, category, filename, lineno, file=None, line=None)

class FlowTestsBase(object):

def _assert_equalish(self, a, b, e=0.05):
delta = a * e
diff = abs(a-b)
if diff > delta:
warnings.warn('runtimes differ by more than \"%f\" percent' % e)

def _assert_only_expected_results_are_in_actual_results(self,
actual_result,
query_info):
Expand Down
3 changes: 1 addition & 2 deletions tests/flow/test_graph_deletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,9 @@ def test10_bulk_edge_deletion_timing(self):
# Delete and benchmark for 300ms.
query = """MATCH (a)-[e:R]->(b) DELETE e"""
result = self.graph.query(query)
query_info = QueryInfo(query = query, description = "Test the execution time for deleting large number of edges", max_run_time_ms = 300)
query_info = QueryInfo(query = query, description = "Test the execution time for deleting large number of edges")
# Test will not fail for execution time > 300ms but a warning will be shown at the test output.
self.env.assertEquals(result.relationships_deleted, 50000)
self._assert_run_time(result, query_info)

def test11_delete_entity_type_validation(self):
# Currently we only support deletion of either nodes, edges or paths
Expand Down
3 changes: 0 additions & 3 deletions tests/flow/test_imdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ def assert_reversed_pattern(self, query, resultset):
# assert result set
self.env.assertEqual(resultset.result_set, actual_result.result_set)

# assert query run time
self._assert_equalish(resultset.run_time_ms, actual_result.run_time_ms)

def test_imdb(self):
for q in self.queries:
query = q.query
Expand Down

0 comments on commit f81c5ef

Please sign in to comment.