Skip to content

Issue 6753 - Removing ticket49412_test and porting to DSLdapObject#7428

Open
aadhikar wants to merge 1 commit into389ds:mainfrom
aadhikar:ticket-49412-changelog-type-validation
Open

Issue 6753 - Removing ticket49412_test and porting to DSLdapObject#7428
aadhikar wants to merge 1 commit into389ds:mainfrom
aadhikar:ticket-49412-changelog-type-validation

Conversation

@aadhikar
Copy link
Copy Markdown
Contributor

@aadhikar aadhikar commented Apr 22, 2026

Description:
The old ticket49412_test.py had compatibility issues.
This ports the functionality to changelog_test.py
using modern Changelog5 class from lib389.

Relates: #6753

Reviewed by: ???
Assisted by: Claude

Summary by Sourcery

Migrate legacy changelog type validation coverage into the replication changelog test suite and remove the obsolete ticket-specific test file.

Tests:

  • Add a replication changelog test that validates string-based maxage and trim interval configuration using the Changelog5 helper.
  • Remove the deprecated ticket49412_test.py now that its coverage is provided in the changelog test suite.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The test mutates the changelog maxage and triminterval but never restores the original values; consider capturing the initial values and using a try/finally (or fixture) to reset the configuration to avoid cross-test side effects.
  • The test name and docstring suggest validating types/values, but only the happy-path of valid string values is exercised; either extend the test to cover invalid values and expected failures or rename it to reflect that it only verifies valid value handling.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The test mutates the changelog maxage and triminterval but never restores the original values; consider capturing the initial values and using a try/finally (or fixture) to reset the configuration to avoid cross-test side effects.
- The test name and docstring suggest validating types/values, but only the happy-path of valid string values is exercised; either extend the test to cover invalid values and expected failures or rename it to reflect that it only verifies valid value handling.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/389ds-389-ds-base-7428
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Comment thread dirsrvtests/tests/suites/replication/changelog_test.py
Description:
Port test to changelog_test.py using Changelog/Changelog5 classes,
supporting both legacy and new changelog. Replace wildcard imports.

Relates: 389ds#6753

Reviewed by: @bsimonova (Thanks!)

Assisted by: Claude
@aadhikar aadhikar force-pushed the ticket-49412-changelog-type-validation branch from ad9f7de to 5cfe891 Compare April 24, 2026 12:07
@aadhikar aadhikar requested a review from bsimonova April 24, 2026 12:07
@aadhikar
Copy link
Copy Markdown
Contributor Author

Note: changelog_test.py is not part of the CI test matrix. test_changelog_type_validation was verified locally and passes on both LMDB and BDB backends.

cl.replace(MAXAGE, '60s')

log.info('Setting changelog trim interval to 10s')
cl.replace(TRIMINTERVAL, '10s')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think the time unit "s" is supported. The trim interval is always in seconds. So just "10" is sufficient.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mreynolds389
I believe 's' is supported, see is_valid_duration_unit(): https://github.com/389ds/389-ds-base/blob/main/ldap/servers/slapd/time.c#L716-L734

But happy to change it to just '10' if you would prefer keeping it without the unit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indeed it's allowed, ok leave it as it.

@aadhikar aadhikar requested a review from mreynolds389 April 29, 2026 13:07
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.

3 participants