add e2e test prototype
This commit is contained in:
@@ -40,6 +40,7 @@ add_subdirectory(write_procedures)
|
||||
add_subdirectory(magic_functions)
|
||||
add_subdirectory(module_file_manager)
|
||||
add_subdirectory(monitoring_server)
|
||||
add_subdirectory(util_e2e)
|
||||
|
||||
copy_e2e_python_files(pytest_runner pytest_runner.sh "")
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/memgraph-selfsigned.crt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
5
tests/e2e/util_e2e/CMakeLists.txt
Normal file
5
tests/e2e/util_e2e/CMakeLists.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
function(copy_util_e2e_python_files FILE_NAME)
|
||||
copy_e2e_python_files(write_procedures ${FILE_NAME})
|
||||
endfunction()
|
||||
|
||||
copy_util_e2e_python_files(simple_case_nullcheck.py)
|
||||
23
tests/e2e/util_e2e/simple_case_nullcheck.py
Normal file
23
tests/e2e/util_e2e/simple_case_nullcheck.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import typing
|
||||
import mgclient
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
|
||||
def test_nullcheck_yields_error(connection):
|
||||
cursor = connection.cursor()
|
||||
query = """WITH 2 AS name
|
||||
RETURN CASE name
|
||||
WHEN 3 THEN 'works'
|
||||
WHEN null THEN "doesn't work"
|
||||
ELSE 'something went wrong'
|
||||
END"""
|
||||
|
||||
cursor.execute(query)
|
||||
row = cursor.fetchone()
|
||||
|
||||
assert row == "Use the generic form when checking against NULL."
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(pytest.main([__file__, "-rA"]))
|
||||
13
tests/e2e/util_e2e/workloads.yaml
Normal file
13
tests/e2e/util_e2e/workloads.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
template_cluster: &template_cluster
|
||||
cluster:
|
||||
main:
|
||||
args: ["--bolt-port", "7687", "--log-level=TRACE"]
|
||||
log_file: "util-e2e.log"
|
||||
setup_queries: []
|
||||
validation_queries: []
|
||||
|
||||
workloads:
|
||||
- name: "CASE throws if simple form is used and checking against NULL"
|
||||
binary: "tests/e2e/pytest_runner.sh"
|
||||
args: ["util_e2e/simple_case_nullcheck.py"]
|
||||
<<: *template_cluster
|
||||
Reference in New Issue
Block a user