Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.15.z] Fix flaky SyncPlans in cli_factory #14351

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #14337

Problem Statement

Some CLI SyncPlan tests are failing randomly. The reason is that cli_factory takes random interval (when not provided explicitly) in options and ignores that custom cron needs additional cron-interval option, so the tests fail on validation.

robottelo.exceptions.CLIFactoryError: Failed to create SyncPlan with data:
{ 'description': 'QpRNvtrDBf',
  'enabled': 'false',
  'interval': 'custom cron',
  'name': 'KwgvwcaNvc',
  'organization-id': 3,
  'sync-date': '2024-03-07 01:33:04'}
Command "sync-plan create" finished with status 70
stderr contains:
Could not create the sync plan:
  Cron expression is not valid!

Plus one small param fix forgotten in CLI refactor.

Solution

Do not pick custom cron randomly from factory and check the cron-interval is provided when custom cron is used.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/cli/test_syncplan.py

@Satellite-QE Satellite-QE requested a review from a team as a code owner March 11, 2024 14:48
@Satellite-QE Satellite-QE added the 6.15.z Introduced in or relating directly to Satellite 6.15 label Mar 11, 2024
@Satellite-QE Satellite-QE requested a review from a team as a code owner March 11, 2024 14:48
@Satellite-QE Satellite-QE added Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Mar 11, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_syncplan.py

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Mar 11, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 6021
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_syncplan.py --external-logging
Test Result : ================ 85 passed, 211 warnings in 2760.60s (0:46:00) =================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 11, 2024
@Satellite-QE Satellite-QE merged commit 896cfe8 into 6.15.z Mar 11, 2024
15 of 16 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.15.z-2b8c8e98df53efc059358ebc3027b37f1b4392a9 branch March 11, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants