Skip to content

Conversation

@nicolau-manubens
Copy link
Contributor

@nicolau-manubens nicolau-manubens commented Nov 19, 2025

Description

Adds wipe unit tests.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌈🌦️📖🚧 Documentation Z3FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/z3fdb/pull-requests/PR-199

🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/fdb/pull-requests/PR-199

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 79.19708% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.72%. Comparing base (e2621a3) to head (e141e0d).

Files with missing lines Patch % Lines
tests/fdb/api/test_wipe.cc 80.14% 53 Missing ⚠️
src/dummy_daos/daos.cc 66.66% 1 Missing ⚠️
src/dummy_daos/daos/tests_lib.cc 50.00% 1 Missing ⚠️
tests/fdb/daos/test_daos_catalogue.cc 0.00% 1 Missing ⚠️
tests/fdb/daos/test_daos_store.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #199      +/-   ##
===========================================
+ Coverage    72.62%   72.72%   +0.10%     
===========================================
  Files          360      361       +1     
  Lines        21705    21924     +219     
  Branches      2244     2255      +11     
===========================================
+ Hits         15764    15945     +181     
- Misses        5941     5979      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

using namespace eckit;

namespace {
void deldir(eckit::PathName& p) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure I've seen this functionality elsewhere before. Is there not a helper function we should be using?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

being addressed in ecmwf/eckit#236

namespace test {

CASE("Setup") {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right.

Test cases should be self contained (using an object as a fixture if needed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


char data[] = "test";

SECTION("WIPE MULTIPLE DATABASES; DRY-RUN WIPE") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know why the label is in all-caps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sometimes helpful to quickly see where the output for a given section starts or ends in the middle of long and cluttered test outputs.

// wipe one database
fdb5::WipeElement elem;
auto wipeObject = fdb.wipe(dbReq1, true);
while (wipeObject.next(elem))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always put {} for if and while if the contents are on a separate line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually fixed for now, but a discussion is taking place separately to potentially add this into clang-format.

// FDB configurations to test

std::string localSingleRootConfig{
"spaces:\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use C++ multi-line strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants