Skip to content

fix(tests): make user_groups integration tests distro-aware#6889

Open
mmummigatti wants to merge 1 commit into
canonical:mainfrom
mmummigatti:rhel-fix-user-group
Open

fix(tests): make user_groups integration tests distro-aware#6889
mmummigatti wants to merge 1 commit into
canonical:mainfrom
mmummigatti:rhel-fix-user-group

Conversation

@mmummigatti

@mmummigatti mmummigatti commented May 20, 2026

Copy link
Copy Markdown

The integration tests for users_groups module had Ubuntu-specific
assumptions that prevented them from running on RHEL-family systems.

Changes:

  • Add skipif decorators to Ubuntu-specific warning tests (test_initial_warnings,
    test_nopassword_unlock_warnings) since warning formats differ across distros
  • Remove redundant IS_UBUNTU checks inside skipif-decorated tests
  • Restore test_sudoers_includedir decorators with distro-aware skipif logic:
    'IS_UBUNTU and CURRENT_RELEASE < JAMMY' allows the test to run on RHEL
    and modern Ubuntu while skipping only on old Ubuntu releases lacking
    required sudo version
  • Add JAMMY import needed for the distro-aware skipif condition

These changes ensure tests either:

  1. Run on all distros with appropriate handling, or
  2. Skip gracefully on distros where the test isn't applicable

This allows the test suite to pass on both Ubuntu and RHEL-family systems.

@ani-sinha ani-sinha left a comment

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.

Can you please check that tests pass with both RHEL and Ubuntu images?

if IS_UBUNTU and CURRENT_RELEASE > NOBLE
else []
)

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.

whitespace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address this comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These blank lines were added to satisfy tox formatting requirements.
I've updated the commit message to document this.

Comment thread tests/integration_tests/modules/test_users_groups.py Outdated
class_client.execute("passwd -d foobar")
class_client.instance.clean()
class_client.restart()

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.

whitespace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These blank lines were added to satisfy tox formatting requirements.
I've updated the commit message to document this.

Comment thread tests/integration_tests/modules/test_users_groups.py Outdated
Comment thread tests/integration_tests/modules/test_users_groups.py Outdated
Comment thread tests/integration_tests/modules/test_users_groups.py
@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch 2 times, most recently from 831efb8 to cc3f091 Compare May 29, 2026 09:00
Comment thread tests/integration_tests/modules/test_users_groups.py
@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch from cc3f091 to c2f7817 Compare May 29, 2026 10:23
IS_UBUNTU,
JAMMY,
NOBLE,

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.

Is this space required?

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.

If this is for tox formatting, please add a comment to that effect in the commit log.


verify_clean_boot(
class_client,
ignore_warnings=True, # ignore warnings about existing groups

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.

why remove this comment? Its not related to the change.

require_warnings=warnings,
)

)

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 think this is simply whitespace issues. There should be no changes here. Can you double check?

  The integration tests for users_groups module had Ubuntu-specific
  assumptions that prevented them from running on RHEL-family systems.

  Changes:
  - Add skipif decorators to Ubuntu-specific warning tests
  - Remove redundant IS_UBUNTU checks inside skipif-decorated tests
  - Restore test_sudoers_includedir decorators with distro-aware skipif
    logic: 'IS_UBUNTU and CURRENT_RELEASE < JAMMY' allows test to run
    on RHEL and modern Ubuntu while skipping old Ubuntu releases
  - Add JAMMY import needed for the distro-aware skipif condition
@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch from c2f7817 to 40758ef Compare June 9, 2026 08:54

@ani-sinha ani-sinha left a comment

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.

LGTM.

@holmanb holmanb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

if IS_UBUNTU and CURRENT_RELEASE > NOBLE
else []
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address this comment.

class_client.execute("passwd -d foobar")
class_client.instance.clean()
class_client.restart()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address.

@ani-sinha

Copy link
Copy Markdown
Contributor

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch from 40758ef to f171b60 Compare June 15, 2026 05:26
@holmanb

holmanb commented Jun 15, 2026

Copy link
Copy Markdown
Member

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

@ani-sinha

Copy link
Copy Markdown
Contributor

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

If you do not want to have the whitespace changes, please say so. Running tox -e do_format is a standard procedure for other PRs I have submitted. Tox only checks for formatting changes in files we change. This has happend to me also in the past.

@mmummigatti please revert the whitespace changes and also remove the comment in the description.

@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch from f171b60 to fd0ee00 Compare June 16, 2026 06:18
@mmummigatti

Copy link
Copy Markdown
Author

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

If you do not want to have the whitespace changes, please say so. Running tox -e do_format is a standard procedure for other PRs I have submitted. Tox only checks for formatting changes in files we change. This has happend to me also in the past.

@mmummigatti please revert the whitespace changes and also remove the comment in the description.

Reverted whitespace-only changes.

@@ -178,7 +182,6 @@

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 do not understand why these are part of the diff. There should be no changes on these lines if we disregard tox formating issues. Please double check.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed - removed the unnecessary whitespace changes. The current diff now only contains the functional skipif decorators.

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.

Did you forget to force push? I do not see any chnages.

@ani-sinha

ani-sinha commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

If you do not want to have the whitespace changes, please say so. Running tox -e do_format is a standard procedure for other PRs I have submitted. Tox only checks for formatting changes in files we change. This has happend to me also in the past.

https://docs.cloud-init.io/en/23.4/development/#pull-request-checklist

Does this instruction not apply to functional tests? I do not see gitlab actions ran any pylint/tox checks here. So its very confusing for contributors.

@holmanb

holmanb commented Jun 16, 2026

Copy link
Copy Markdown
Member

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

If you do not want to have the whitespace changes, please say so.

What are you trying to say?

Tox only checks for formatting changes in files we change.

I don't believe that this claim is accurate.

This has happend to me also in the past.

Please provide a reproducer. I have not experienced that and couldn't reproduce it here.

I do not see gitlab actions ran any pylint/tox checks here.

You didn't see it because Github Actions runs are gated on maintainer approval for first-time contributors.

@ani-sinha

Copy link
Copy Markdown
Contributor

The concept is good, but this isn't ready for review. Please don't introduce arbitrary whitespace changes in PRs.

@holmanb Medha told me offline that those new lines were required to satisfy tox formatting. @mmummigatti if my understanding is correct, please add a comment to that effect in the commit log.

Github Actions runs format checks on every PR push. This justification doesn't make sense. Why would a PR that changes this file suddenly require other whitespace changes in just this file?

If you do not want to have the whitespace changes, please say so.

What are you trying to say?

The tone of your comment impled medha left those whitespaces accidentally and did not really intentionally add them to satisfy tox. I found that quite frankly hurtful. Is there any reason to believe she was lying?

@holmanb

holmanb commented Jun 16, 2026

Copy link
Copy Markdown
Member

The tone of your comment impled medha left those whitespaces accidentally and did not really intentionally add them to satisfy tox. I found that quite frankly hurtful. Is there any reason to believe she was lying?

Let's keep this on topic, please.

I have never seen tox -e do_format behave the way that you describe, so I need to understand what causes it so that the tooling or contribution docs can be fixed. After re-reading[1] and testing the code, I still see no evidence that tox only checks the files we change. I similarly don't see any version of the formatters that would cause the whitespace changes here. What am I missing?

[1] tox -e do_format just runs some formatters - it has no awareness of git (the same is true of the relevant github workflow). Similarly the versions of the formatters are fixed.

@mmummigatti mmummigatti force-pushed the rhel-fix-user-group branch 2 times, most recently from 2d4142a to 6503a0e Compare June 17, 2026 11:19
@ani-sinha

Copy link
Copy Markdown
Contributor

Is there anything left to do here?

@holmanb

holmanb commented Jun 29, 2026

Copy link
Copy Markdown
Member

@mmummigatti Thank you for dropping the whitespace changes. I think that the CI test failures have been fixed upstream. Please merge the latest version of the main branch. I think that should help get a passing CI run.

@mmummigatti @ani-sinha If you happen to figure out what caused the unexpected whitespace changes, I would still appreciate understanding the root cause. Otherwise I will assume that the issue has resolved itself.

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