Commit fd49d2a5 authored by Ciarán Ó Rourke's avatar Ciarán Ó Rourke
Browse files

Integration tests make target

Integration tests executable using 'make integration_tests'. Clean up CI
a bit.

Change log:
* add integration_tests as a CMake target
* use integration_tests make target in CI
* update README
* CMake command compatible with CentOS7
* CI adjustments
parent 3f1f6802
Pipeline #2313 passed with stages
in 13 minutes and 47 seconds
......@@ -11,7 +11,7 @@ image: ciaranorourke/deimos:centos8
set -x;
cmake
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_EXPORT_COMPILE_COMMANDS="${CMAKE_EXPORT_COMPILE_COMMANDS}"
-DCMAKE_C_COMPILER=${CC}
-DCMAKE_CXX_COMPILER=${CXX}
-DCMAKE_C_FLAGS="$(pkg-config glib-2.0 --cflags) -isystem ${DEPS_DIR}/phobos/include"
......@@ -31,9 +31,7 @@ image: ciaranorourke/deimos:centos8
- &unit_test
make -C build test ARGS=-V
- &integration_test
pushd build/test/integration_tests
&& python3 -m unittest client
&& popd
make -C build integration_tests
.cmake_variables:
default_cmake_variables: &default_cmake_variables
......@@ -42,14 +40,15 @@ image: ciaranorourke/deimos:centos8
DEIMOS_BUILD_TESTS: "ON"
DEIMOS_AUTHORISATION: "ON"
DEIMOS_BUILD_DOCUMENTATION: "OFF"
CMAKE_EXPORT_COMPILE_COMMANDS: "OFF"
CC: gcc
CXX: g++
.default_job: &default_job
tags:
- docker
variables:
<<: *default_cmake_variables
CC: gcc
CXX: g++
before_script:
- dnf update -y
- dnf install -y
......@@ -72,6 +71,7 @@ Format:
<<: *default_job
stage: static analysis
variables:
<<: *default_cmake_variables
CC: clang
CXX: clang++
before_script:
......@@ -92,6 +92,7 @@ Lint:
stage: static analysis
variables:
<<: *default_cmake_variables
CMAKE_EXPORT_COMPILE_COMMANDS: "ON"
CC: clang
CXX: clang++
script:
......@@ -130,14 +131,12 @@ Default:
Authorisation Disabled:
<<: *default_job
stage: test
variables:
<<: *default_cmake_variables
CC: gcc
CXX: g++
DEIMOS_AUTHORISATION: "OFF"
stage: test
centos7:
Centos7:
<<: *default_job
stage: test
image: ciaranorourke/deimos:centos7
......
......@@ -84,7 +84,7 @@ Option | Effect
## Testing
Units test can be run with `make -C build tests`, given `DEIMOS_BUILD_TESTS` was set to `ON` during the build process.
Integration tests can be run from the `test/integration_tests/` directory with `python -m unittest client`.
Integration tests can be run with `make -C build integration_tests`, or from the `test/integration_tests/` directory with `python -m unittest client`.
## Documentation
......@@ -133,4 +133,4 @@ aws_secret_access_key = SECRET_KEY
---
Copyright 2020 Irish Centre for High End Computing (ICHEC), NUI Galway.
\ No newline at end of file
Copyright 2020 Irish Centre for High End Computing (ICHEC), NUI Galway.
......@@ -4,7 +4,14 @@
add_subdirectory(unit_tests)
# Integration tests
add_custom_target(integration_tests ALL)
add_custom_command(TARGET integration_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/integration_tests ${CMAKE_CURRENT_BINARY_DIR}/integration_tests)
\ No newline at end of file
add_custom_target(
integration_tests
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/integration_tests ${CMAKE_CURRENT_BINARY_DIR}/integration_tests
)
add_custom_command(
TARGET integration_tests POST_BUILD
COMMAND python3 -m unittest client
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/integration_tests
)
Supports Markdown
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