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

Cache charmcraft pack container, skip unstable tests except on schedule #95

Merged
merged 4 commits into from
Feb 17, 2023

Conversation

carlcsaposs-canonical
Copy link
Contributor

@carlcsaposs-canonical carlcsaposs-canonical marked this pull request as ready for review February 16, 2023 18:17
on:
pull_request:
paths-ignore:
- '.gitignore'
- '.jujuignore'
- 'LICENSE'
- '**.md'
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
Copy link
Contributor

Choose a reason for hiding this comment

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

Not an issue with the PR itself, but we may consider running the scheduled tests during slightly different times to not stampede on the runners.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I think it's okay to stampede the runners overnight—the runners will just queue up & run as soon as runners are available

Copy link
Contributor

Choose a reason for hiding this comment

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

Starting all MySQL and PostgreSQL repos simultaneously at 00:53 might be noticeable in Los Angeles (16:53 local time).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Starting them later might be noticeable in India, and I figured it'd be better to have a queue at the end of the day instead of the beginning of the day

from pytest_operator.plugin import OpsTest


@pytest.fixture(scope="module")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can even go with session here, it should never change during execution.

Copy link
Contributor Author

@carlcsaposs-canonical carlcsaposs-canonical Feb 17, 2023

Choose a reason for hiding this comment

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

Technically I think that's correct.

However, it multiple modules are run in a test, I think different instances of ops_test should be created since ops_test has attributes for the test model. (Different modules create different models)

In the mysql charms, I left the scope to the default of function to avoid changing the behavior of pytest-operator. The only reason to use scope="module" is to be compatible with other fixtures in the postgres charms. I'm not sure if this is a solid approach, but it seems like it's okay. It does feel a bit hacky already though

@carlcsaposs-canonical carlcsaposs-canonical merged commit 68b1a07 into main Feb 17, 2023
@carlcsaposs-canonical carlcsaposs-canonical deleted the feature/cache-charmcraft-pack branch February 17, 2023 16:39
BON4 pushed a commit to BON4/postgresql-k8s-operator that referenced this pull request May 20, 2024
github-actions bot added a commit to canonical/test-runners-2-is-x64-postgresql-k8s-operator that referenced this pull request Jun 27, 2024
github-actions bot added a commit to canonical/test-runners-2-is-arm64-postgresql-k8s-operator that referenced this pull request Jun 28, 2024
github-actions bot added a commit to canonical/test-runners-2-github-x64-postgresql-k8s-operator that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants