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

compatible: Add pytest-operator plugin for test grouping #65

Merged
merged 18 commits into from
Jul 31, 2023

Conversation

carlcsaposs-canonical
Copy link
Contributor

Will be used in future integration test reusable workflow

@carlcsaposs-canonical
Copy link
Contributor Author

Tested on canonical/mysql-operator#252

Copy link

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

Very promising!


By default, [pytest-operator](https://github.com/charmed-kubernetes/pytest-operator) runs each test file (Python module) in a separate Juju model. Usually, on GitHub, each integration test file is run in parallel (on separate runners).

This plugin allows further parallelization—an individual test file can be split into multiple groups. Each group can run on a separate GitHub runner.

Choose a reason for hiding this comment

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

Nice!

Choose a reason for hiding this comment

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

super nice!

filtered_items.append(function)
elif group_number == config.option.group:
filtered_items.append(function)
items[:] = filtered_items

Choose a reason for hiding this comment

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

curiosity: will not this just override items content? why not just

Suggested change
items[:] = filtered_items
items = filtered_items

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the suggested code will move the reference of items locally but will not replace the original list (and thus, not modify the items)

@carlcsaposs-canonical carlcsaposs-canonical merged commit 33f562c into main Jul 31, 2023
1 check passed
@carlcsaposs-canonical carlcsaposs-canonical deleted the pytest-plugin-groups branch July 31, 2023 15:37
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