Skip to content
Snippets Groups Projects
Verified Commit 2fb08f2c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

REAPPLY: reapply changes after revert on main

parent c0264199
No related branches found
No related tags found
1 merge request!41Release 0.3.0
Pipeline #42837 failed
...@@ -15,7 +15,8 @@ RUN rm -rf .git ...@@ -15,7 +15,8 @@ RUN rm -rf .git
COPY .docker/caosdb-client.json /caosdb-client.json COPY .docker/caosdb-client.json /caosdb-client.json
# build and run tests # Build and run tests.
# If no other command is given to the Docker image
CMD mkdir build && \ CMD mkdir build && \
cd build && \ cd build && \
conan install .. -s "compiler.libcxx=libstdc++11" && \ conan install .. -s "compiler.libcxx=libstdc++11" && \
......
...@@ -78,16 +78,12 @@ build-testenv: &build-testenv ...@@ -78,16 +78,12 @@ build-testenv: &build-testenv
stage: setup stage: setup
timeout: 2h timeout: 2h
needs: [] needs: []
only:
- pipelines
- schedules
- web
script: script:
- *env - *env
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
#build testenv image #build testenv image
- docker pull $CPPLIB_REGISTRY_IMAGE || { CPPLIB_REGISTRY_IMAGE="$CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:dev" ; docker pull $CPPLIB_REGISTRY_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 build - docker build
--build-arg CPPLIB_REGISTRY_IMAGE=$CPPLIB_REGISTRY_IMAGE --build-arg CPPLIB_REGISTRY_IMAGE=$CPPLIB_REGISTRY_IMAGE
--file .docker/Dockerfile --file .docker/Dockerfile
......
...@@ -28,6 +28,7 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md) ...@@ -28,6 +28,7 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md)
- [ ] Up-to-date CHANGELOG.md (or not necessary) - [ ] Up-to-date CHANGELOG.md (or not necessary)
- [ ] Up-to-date JSON schema (or not necessary) - [ ] Up-to-date JSON schema (or not necessary)
- [ ] Appropriate user and developer documentation (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 use the software? Assume "stupid" users.
- How do I develop or debug the software? Assume novice developers. - How do I develop or debug the software? Assume novice developers.
- [ ] Annotations in code (Gitlab comments) - [ ] Annotations in code (Gitlab comments)
...@@ -41,7 +42,8 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md) ...@@ -41,7 +42,8 @@ guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md)
- [ ] I understand the intent of this MR - [ ] I understand the intent of this MR
- [ ] All automated tests pass - [ ] All automated tests pass
- [ ] Up-to-date CHANGELOG.md (or not necessary) - [ ] Up-to-date CHANGELOG.md (or not necessary)
- [ ] Appropriate user and developer documentation (or not necessary) - [ ] Appropriate user and developer documentation (or not necessary), also in published
documentation.
- [ ] The test environment setup works and the intended behavior is reproducible in the test - [ ] The test environment setup works and the intended behavior is reproducible in the test
environment environment
- [ ] In-code documentation and comments are up-to-date. - [ ] In-code documentation and comments are up-to-date.
......
...@@ -19,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
* Fixed failing async test.
### Security ### Security
...@@ -25,6 +25,11 @@ Create a local conan package from the caosdb-cpplib repository ...@@ -25,6 +25,11 @@ Create a local conan package from the caosdb-cpplib repository
path to the pem file in the `CAOSDB_SERVER_CERT` environment variable. path to the pem file in the `CAOSDB_SERVER_CERT` environment variable.
7. Run with `ctest` in the build directory. 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 ## ## Formatting, style, linting ##
`make format` `make format`
[requires] [requires]
caosdb/0.2.2 caosdb/[>=0.3.0-dev, include_prerelease=True]
[build_requires] [build_requires]
gtest/1.11.0 gtest/1.11.0
......
...@@ -53,13 +53,19 @@ TEST(test_async, retrieve_non_existing) { ...@@ -53,13 +53,19 @@ TEST(test_async, retrieve_non_existing) {
auto status = transaction->GetStatus(); auto status = transaction->GetStatus();
EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING); EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING);
// wait some time // 1000ms are not always sufficient, when there is very high pipeline load.
std::this_thread::sleep_for(1000ms); auto count = 1000;
auto code = transaction->GetStatus().GetCode();
do {
// wait some time
std::this_thread::sleep_for(10ms);
// DONT call WaitForIt -> the transaction finishes in the back-ground // DONT call WaitForIt -> the transaction finishes in the background
status = transaction->GetStatus(); code = transaction->GetStatus().GetCode();
EXPECT_EQ(status.GetCode(), TransactionStatus::TRANSACTION_ERROR().GetCode()); } while (--count > 0 && code == StatusCode::EXECUTING);
ASSERT_EQ(status.GetCode(), StatusCode::GENERIC_TRANSACTION_ERROR); ASSERT_GT(count, 0) << "ERROR: Timeout while waiting for transaction.";
EXPECT_EQ(code, TransactionStatus::TRANSACTION_ERROR().GetCode());
ASSERT_EQ(code, StatusCode::GENERIC_TRANSACTION_ERROR);
const auto &result_set = transaction->GetResultSet(); const auto &result_set = transaction->GetResultSet();
......
...@@ -363,9 +363,7 @@ TEST_F(test_select, test_select_property_unit) { ...@@ -363,9 +363,7 @@ TEST_F(test_select, test_select_property_unit) {
EXPECT_EQ(query_transaction->GetResultTable().size(), 1); EXPECT_EQ(query_transaction->GetResultTable().size(), 1);
for (const auto &row : query_transaction->GetResultTable().GetRows()) { for (const auto &row : query_transaction->GetResultTable().GetRows()) {
// Fails due to https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/264 EXPECT_EQ(row.GetValue("TestPropDouble.unit").GetAsString(), "m");
EXPECT_NONFATAL_FAILURE({ EXPECT_EQ(row.GetValue("TestPropDouble.unit").GetAsString(), "m"); },
"TestPropDouble.unit");
} }
} }
......
...@@ -1342,11 +1342,9 @@ TEST_F(test_transaction, test_delete_string_id) { ...@@ -1342,11 +1342,9 @@ TEST_F(test_transaction, test_delete_string_id) {
EXPECT_TRUE(transaction->GetStatus().IsTerminated()); EXPECT_TRUE(transaction->GetStatus().IsTerminated());
EXPECT_TRUE(transaction->GetStatus().IsError()); EXPECT_TRUE(transaction->GetStatus().IsError());
const auto &results = transaction->GetResultSet(); const auto &results = transaction->GetResultSet();
EXPECT_FALSE(results.at(0).HasErrors());
EXPECT_TRUE(results.at(1).HasErrors()); EXPECT_TRUE(results.at(1).HasErrors());
EXPECT_EQ(results.at(1).GetErrors().size(), 1); EXPECT_EQ(results.at(1).GetErrors().size(), 1);
EXPECT_EQ(results.at(1).GetErrors().at(0).GetDescription(), "Entity does not exist."); EXPECT_EQ(results.at(1).GetErrors().at(0).GetDescription(), "Entity does not exist.");
EXPECT_FALSE(results.at(2).HasErrors());
} }
} // namespace caosdb::transaction } // namespace caosdb::transaction
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment