diff --git a/.docker/Dockerfile b/.docker/Dockerfile index aecabd55b43aa0a4ca25d4a620e2a3909ffb7865..78d449bc9e333de857c044d18653868c5f8f2537 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -7,7 +7,6 @@ COPY .docker/wait-for-it.sh /wait-for-it.sh WORKDIR /libcaosdb/ RUN mkdir build WORKDIR /libcaosdb/build -RUN conan install .. RUN cmake .. RUN cmake --build . RUN cmake --install . --prefix /usr/local/ @@ -24,4 +23,4 @@ CMD mkdir build && \ cmake -D CMAKE_PREFIX_PATH=/usr/local/ .. && \ cmake --build . && \ /wait-for-it.sh caosdb-server:10443 -t 500 -- \ - ctest + ctest -V diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85e7a55651e8b6cdf22536b56e5aeee2071220f3..a40e6d014881c69af46948ac2993aba1192c67ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,7 +66,7 @@ info: # Build a docker image in which tests for this repository can run -.build-testenv: &build-testenv +build-testenv: &build-testenv tags: [cached-dind] image: docker:20.10.6 stage: setup @@ -100,26 +100,6 @@ info: - docker push $CPPINTTEST_REGISTRY_IMAGE - docker save $CPPINTTEST_REGISTRY_IMAGE > /image-cache/${CPPINTTEST_IMAGE_CACHE} -build-testenv-changes-docker: - <<: *build-testenv - only: - changes: - - .docker/* - except: - refs: - - pipeline - - schedules - - web - - -build-testenv-triggered: - <<: *build-testenv - only: - refs: - - pipeline - - schedules - - web - # build integration tests build-test: @@ -180,7 +160,7 @@ test: # store versions of CaosDB parts - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_server_commit | tee hash_server - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_mysqlbackend_commit | tee hash_mysql - - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_proto_commit | tee hash_server + - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_proto_commit | tee hash_proto # the pyinttest docker writes the return value of the tests into the # file result diff --git a/test/test_connection.cpp b/test/test_connection.cpp index 6ecc441fcf1598bfa057965fea2708548ff5c1a0..c6362b85643f71fb1feb006fbf9f258358873076 100644 --- a/test/test_connection.cpp +++ b/test/test_connection.cpp @@ -50,10 +50,11 @@ TEST(test_connection, connect_somehost_42347_fails) { auto config = std::make_shared<InsecureCaosDBConnectionConfig>(host, port); CaosDBConnection connection(config); + // TODO ConnectionError ASSERT_THROW(connection.getVersionInfo(), std::runtime_error); } -TEST(test_connection, connection_caosdb_server_insecure_success) { +TEST(test_connection, connection_insecure_authentication_error) { auto port = 8080; const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost"); auto major = 0; @@ -62,12 +63,11 @@ TEST(test_connection, connection_caosdb_server_insecure_success) { auto config = std::make_shared<InsecureCaosDBConnectionConfig>(host, port); auto connection = CaosDBConnection(config); - auto v_info = connection.getVersionInfo(); - ASSERT_EQ(major, v_info.major()); - ASSERT_EQ(minor, v_info.minor()); + // TODO AuthenticationError + ASSERT_THROW(connection.getVersionInfo(), std::runtime_error); } -TEST(test_connection, connection_caosdb_server_ssl_success) { +TEST(test_connection, connection_ssl_authentication_error) { auto port = 8443; const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost"); const auto path = caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string()); @@ -78,12 +78,11 @@ TEST(test_connection, connection_caosdb_server_ssl_success) { auto config = std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions); auto connection = CaosDBConnection(config); - auto v_info = connection.getVersionInfo(); - ASSERT_EQ(major, v_info.major()); - ASSERT_EQ(minor, v_info.minor()); + // TODO AuthenticationError + ASSERT_THROW(connection.getVersionInfo(), std::runtime_error); } -TEST(test_connection, connection_with_authentication_success) { +TEST(test_connection, connection_ssl_authentication_success) { auto port = 8443; const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost"); const auto path = caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());