Skip to content
Snippets Groups Projects
Commit 4f27447a authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Merge branch 'mi_apitests_for_ci' into 'master'

apitests for ci started with cmake and ctest

See merge request !10
parents 6998ceb5 48715d1c
No related branches found
No related tags found
1 merge request!10apitests for ci started with cmake and ctest
Showing
with 38 additions and 19 deletions
...@@ -10,7 +10,7 @@ configure_file("${CMAKE_CURRENT_LIST_DIR}/jsonsocket.py" "${CMAKE_BINARY_DIR}/te ...@@ -10,7 +10,7 @@ configure_file("${CMAKE_CURRENT_LIST_DIR}/jsonsocket.py" "${CMAKE_BINARY_DIR}/te
# @product - hived or hivemind # @product - hived or hivemind
macro(ADD_API_TEST common_working_dir directory_with_test product api_name test_name) macro(ADD_API_TEST common_working_dir directory_with_test product api_name test_name)
set(working_dir ${CMAKE_BINARY_DIR}/tests) set(working_dir ${CMAKE_BINARY_DIR}/tests)
set(api_test_directory ${directory_with_test}/${product}/${api_name}) set(api_test_directory ${directory_with_test}/${product}/reference/${api_name})
set(test_script_path ${api_test_directory}/${test_name}.py) set(test_script_path ${api_test_directory}/${test_name}.py)
message(STATUS "Adding ${api_name}/${test_name} to test list") message(STATUS "Adding ${api_name}/${test_name} to test list")
set(extra_macro_args ${ARGN}) set(extra_macro_args ${ARGN})
...@@ -19,10 +19,29 @@ macro(ADD_API_TEST common_working_dir directory_with_test product api_name test_ ...@@ -19,10 +19,29 @@ macro(ADD_API_TEST common_working_dir directory_with_test product api_name test_
if (${num_extra_args} GREATER 0) if (${num_extra_args} GREATER 0)
set(test_parameters ${test_script_path} ${TEST_NODE} ${REFERENCE_NODE} ${working_dir} ${extra_macro_args}) set(test_parameters ${test_script_path} ${TEST_NODE} ${REFERENCE_NODE} ${working_dir} ${extra_macro_args})
endif() endif()
add_test(NAME "api/${api_name}/${test_name}" COMMAND python3 ${test_parameters} WORKING_DIRECTORY ${working_dir}) set(test "api/reference/${api_name}/${test_name}")
set_property(TEST "api/${api_name}/${test_name}" PROPERTY LABELS python_tests ${api_name} ${test_name}) add_test(NAME "${test}" COMMAND python3 ${test_parameters} WORKING_DIRECTORY ${working_dir})
set_property(TEST ${test} PROPERTY LABELS api_reference_tests)
endmacro(ADD_API_TEST) endmacro(ADD_API_TEST)
# @common_working_dir - the root of working directories for all the api test
# @directory_with_test - full path to tests_api repo on the disk
# @product - hived or hivemind
# @blocks - number of synchronized blocks
# @api_name - full api name i.e. condenser_api
macro(ADD_API_PYREST_TEST common_working_dir directory_with_test product blocks api_name)
# set(working_dir ${CMAKE_BINARY_DIR}/tests)
set( pyrest_tests_subdir "pyrest_tests" )
set(working_dir ${directory_with_test}/${product}/${pyrest_tests_subdir})
set(test_file_path ${directory_with_test}/${product}/${pyrest_tests_subdir}/${blocks}/${api_name}/${api_name}_test.yaml)
set(api_test_directory ${directory_with_test}/${product}/${pyrest_tests_subdir}/${api_name})
set(test_name "api/pyresttests/${blocks}/${api_name}")
message(STATUS "Adding ${test_name}" )
set(test_parameters ${test_file_path} "--import_extensions=validator_ex\;comparator_equal")
add_test(NAME ${test_name} COMMAND pyresttest ${TEST_NODE} ${test_parameters} WORKING_DIRECTORY ${working_dir})
set_property(TEST ${test_name} PROPERTY LABELS "pyresttests")
endmacro(ADD_API_PYREST_TEST)
# @directory_with_test - full path to tests_api repo on the disk # @directory_with_test - full path to tests_api repo on the disk
# @product - hived or hivemind # @product - hived or hivemind
macro(ADD_API_SMOKETEST directory_with_test product) macro(ADD_API_SMOKETEST directory_with_test product)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
sys.path.append(os.path.dirname(__file__) + "/../../") sys.path.append(os.path.dirname(__file__) + "/../../../")
import json import json
from testbase import SimpleJsonTest from testbase import SimpleJsonTest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment