diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 29e439b0a97505591a74e2407ba17bcc584f45e4..98f12aabb4ddf22f9375c97669e025adaed6b627 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -15,8 +15,7 @@ RUN rm -rf .git COPY .docker/caosdb-client.json /caosdb-client.json -# Build and run tests. -# If no other command is given to the Docker image +# build and run tests CMD mkdir build && \ cd build && \ conan install .. -s "compiler.libcxx=libstdc++11" && \ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93e5484652c11d1694a21f0aee6703e56d9d879f..8027befbc7deb93168a888f7c3354685eb661f81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,12 +78,16 @@ build-testenv: &build-testenv stage: setup timeout: 2h needs: [] + only: + - pipelines + - schedules + - web script: - *env - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY #build testenv image - - docker pull $CPPLIB_REGISTRY_IMAGE || { CPPLIB_REGISTRY_IMAGE="$CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:dev" ; echo "Using cpplib@dev instead."; docker pull $CPPLIB_REGISTRY_IMAGE ; } + - docker pull $CPPLIB_REGISTRY_IMAGE || { CPPLIB_REGISTRY_IMAGE="$CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:dev" ; docker pull $CPPLIB_REGISTRY_IMAGE ; } - docker build --build-arg CPPLIB_REGISTRY_IMAGE=$CPPLIB_REGISTRY_IMAGE --file .docker/Dockerfile diff --git a/.gitlab/merge_request_templates/Default.md b/.gitlab/merge_request_templates/Default.md index 3629e0ca3695000863d8c254516f64bf59a7bf60..35c6d01c5904289b77fc7f1de9419ef91a1510e9 100644 --- a/.gitlab/merge_request_templates/Default.md +++ b/.gitlab/merge_request_templates/Default.md @@ -28,7 +28,6 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md) - [ ] Up-to-date CHANGELOG.md (or not necessary) - [ ] Up-to-date JSON schema (or not necessary) - [ ] Appropriate user and developer documentation (or not necessary) - - Update / write published documentation (`make doc`). - How do I use the software? Assume "stupid" users. - How do I develop or debug the software? Assume novice developers. - [ ] Annotations in code (Gitlab comments) @@ -42,8 +41,7 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md) - [ ] I understand the intent of this MR - [ ] All automated tests pass - [ ] Up-to-date CHANGELOG.md (or not necessary) -- [ ] Appropriate user and developer documentation (or not necessary), also in published - documentation. +- [ ] Appropriate user and developer documentation (or not necessary) - [ ] The test environment setup works and the intended behavior is reproducible in the test environment - [ ] In-code documentation and comments are up-to-date. diff --git a/CHANGELOG.md b/CHANGELOG.md index fcdf01692fe8dbcd0dfa40ae7ae9eb7f596a5cf3..449e4256f907780bfbd0ce3d6a23853f20de0ae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -* Fixed failing async test. - ### Security diff --git a/README.md b/README.md index 46060729d020e592e1087eaa28effe4a1df96216..2940e2a42d15505ccbbf68a107d7ee5e3f490e0b 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,6 @@ Create a local conan package from the caosdb-cpplib repository path to the pem file in the `CAOSDB_SERVER_CERT` environment variable. 7. Run with `ctest` in the build directory. -### Troubleshooting ### - -- If you don't have `clang-tidy` installed, you can run the first `cmake` command with - `LINTING=OFF`: `cmake -D LINTING=OFF -B . ..` - ## Formatting, style, linting ## `make format` diff --git a/conanfile.txt b/conanfile.txt index cd80b1474b1d209d6678d95b12a958e3110163ba..54cdf1b2a75680c3132e80f31bc56507c5273c38 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,5 +1,5 @@ [requires] -caosdb/[>=0.3.0-dev, include_prerelease=True] +caosdb/0.2.2 [build_requires] gtest/1.11.0 diff --git a/test/test_async.cpp b/test/test_async.cpp index bf437f6065f386ccfd49b01c56bc6b6d31848af0..c8049865abfb74b662c9f2e63619da80fcc7376b 100644 --- a/test/test_async.cpp +++ b/test/test_async.cpp @@ -53,19 +53,13 @@ TEST(test_async, retrieve_non_existing) { auto status = transaction->GetStatus(); EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING); - // 1000ms are not always sufficient, when there is very high pipeline load. - auto count = 1000; - auto code = transaction->GetStatus().GetCode(); - do { - // wait some time - std::this_thread::sleep_for(10ms); + // wait some time + std::this_thread::sleep_for(1000ms); - // DONT call WaitForIt -> the transaction finishes in the background - code = transaction->GetStatus().GetCode(); - } while (--count > 0 && code == StatusCode::EXECUTING); - ASSERT_GT(count, 0) << "ERROR: Timeout while waiting for transaction."; - EXPECT_EQ(code, TransactionStatus::TRANSACTION_ERROR().GetCode()); - ASSERT_EQ(code, StatusCode::GENERIC_TRANSACTION_ERROR); + // DONT call WaitForIt -> the transaction finishes in the back-ground + status = transaction->GetStatus(); + EXPECT_EQ(status.GetCode(), TransactionStatus::TRANSACTION_ERROR().GetCode()); + ASSERT_EQ(status.GetCode(), StatusCode::GENERIC_TRANSACTION_ERROR); const auto &result_set = transaction->GetResultSet(); diff --git a/test/test_select.cpp b/test/test_select.cpp index fa63eefc69e52a6ebc292495e02f35b45b1e29a1..f8809540a33d8ff753dda8b56892edc38ed4745f 100644 --- a/test/test_select.cpp +++ b/test/test_select.cpp @@ -363,7 +363,9 @@ TEST_F(test_select, test_select_property_unit) { EXPECT_EQ(query_transaction->GetResultTable().size(), 1); for (const auto &row : query_transaction->GetResultTable().GetRows()) { - EXPECT_EQ(row.GetValue("TestPropDouble.unit").GetAsString(), "m"); + // Fails due to https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/264 + EXPECT_NONFATAL_FAILURE({ EXPECT_EQ(row.GetValue("TestPropDouble.unit").GetAsString(), "m"); }, + "TestPropDouble.unit"); } } diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index 2b1be4c04250c989a3f2283ad24dab438625df62..aff1c6eb5aacfcd26de096789a5cecfbcda3f2fd 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -1342,9 +1342,11 @@ TEST_F(test_transaction, test_delete_string_id) { EXPECT_TRUE(transaction->GetStatus().IsTerminated()); EXPECT_TRUE(transaction->GetStatus().IsError()); const auto &results = transaction->GetResultSet(); + EXPECT_FALSE(results.at(0).HasErrors()); EXPECT_TRUE(results.at(1).HasErrors()); EXPECT_EQ(results.at(1).GetErrors().size(), 1); EXPECT_EQ(results.at(1).GetErrors().at(0).GetDescription(), "Entity does not exist."); + EXPECT_FALSE(results.at(2).HasErrors()); } } // namespace caosdb::transaction