Skip to content

Commit

Permalink
add changes from plugin pr
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Jul 28, 2023
1 parent b8b961e commit d79426a
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
echo "mark_expression=not unstable" >> "$GITHUB_OUTPUT"
fi
- name: Run integration tests
run: tox run -e integration -- "${{ matrix.groups.path_to_test_file }}" --group ${{ matrix.groups.group_number }} -m '${{ steps.select-test-stability.outputs.mark_expression }}' --mysql-charm-series="${{ matrix.ubuntu-versions.series }}" --mysql-charm-bases-index="${{ matrix.ubuntu-versions.bases-index }}"
run: tox run -e integration -- "${{ matrix.groups.path_to_test_file }}" --group="${{ matrix.groups.group_number }}" -m '${{ steps.select-test-stability.outputs.mark_expression }}' --mysql-charm-series="${{ matrix.ubuntu-versions.series }}" --mysql-charm-bases-index="${{ matrix.ubuntu-versions.bases-index }}"
env:
AWS_ACCESS_KEY: ${{ matrix.groups.path_to_test_file != 'tests/integration/test_backups.py' || secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ matrix.groups.path_to_test_file != 'tests/integration/test_backups.py' || secrets.AWS_SECRET_KEY }}
Expand Down
113 changes: 66 additions & 47 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ tenacity = "^8.2.2"
boto3 = "^1.28.11"
pyyaml = "^6.0"
urllib3 = "^1.26.16"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", rev = "v3", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v4.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", branch = "pytest-plugin-groups", subdirectory = "python/pytest_plugins/pytest_operator_groups"}


[tool.coverage.run]
Expand Down
13 changes: 3 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
from argparse import ArgumentError

import argparse


def pytest_addoption(parser):
parser.addoption(
"--collect-groups",
action="store_true",
help="Collect test groups (used by GitHub Actions)",
)
parser.addoption("--group", type=int, help="Integration test group number")
parser.addoption("--mysql-charm-series", help="Ubuntu series for mysql charm (e.g. jammy)")
parser.addoption(
"--mysql-charm-bases-index",
Expand All @@ -19,12 +14,10 @@ def pytest_addoption(parser):


def pytest_configure(config):
if config.option.collect_groups:
config.option.collectonly = True
if (config.option.mysql_charm_series is None) ^ (
config.option.mysql_charm_bases_index is None
):
raise ArgumentError(
raise argparse.ArgumentError(
None, "--mysql-charm-series and --mysql-charm-bases-index must be given together"
)
# Note: Update defaults whenever charmcraft.yaml is changed
Expand Down
Loading

0 comments on commit d79426a

Please sign in to comment.