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

draft: PoC for refactor CI epic #571

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: fix individual charm tests
orfeas-k committed Sep 17, 2024
commit 7fb5832190036e49e002764a2a3d2de54172a0e9
7 changes: 0 additions & 7 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
@@ -123,20 +123,13 @@ jobs:
# Pinned to 3.x/stable due to https://github.com/canonical/charmcraft/issues/1845
charmcraft-channel: 3.x/stable

- name: echo things
run: |
echo $GITHUB_WORKSPACE
echo ${{ needs.build.outputs.artifact-prefix }}

- name: Download packed charm(s)
id: download-charms
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
pattern: packed-charm-cache-true-.-charms-${{ matrix.charm }}-*
merge-multiple: true
path: ./charms/${{ matrix.charm }}


- name: Integration tests
run: |
11 changes: 6 additions & 5 deletions charms/kfp-api/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
@@ -41,14 +41,15 @@
MYSQL_TRUST = True


@pytest.fixture
def use_packed_charms() -> str:
"""Return environment variable `USE_PACKED_CHARMS`. If it's not found, return `false`."""
return os.environ.get("USE_PACKED_CHARMS", "false").replace('"', "")


class TestCharm:
"""Integration test charm"""

@pytest.fixture
def use_packed_charms() -> str:
"""Return environment variable `USE_PACKED_CHARMS`. If it's not found, return `false`."""
return os.environ.get("USE_PACKED_CHARMS", "false").replace('"', "")

@pytest.mark.abort_on_fail
async def test_build_and_deploy(self, ops_test: OpsTest, use_packed_charms):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this a setting, or have the logic to

  1. By default try to get_packed_charms
  2. If not, then ops_test.build_charm

??

"""Deploy kfp-api with required charms and relations."""
11 changes: 6 additions & 5 deletions charms/kfp-persistence/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
@@ -37,14 +37,15 @@
MINIO_CONFIG = {"access-key": "minio", "secret-key": "minio-secret-key"}


@pytest.fixture
def use_packed_charms() -> str:
"""Return environment variable `USE_PACKED_CHARMS`. If it's not found, return `false`."""
return os.environ.get("USE_PACKED_CHARMS", "false").replace('"', "")


class TestCharm:
"""Integration test charm"""

@pytest.fixture
def use_packed_charms() -> str:
"""Return environment variable `USE_PACKED_CHARMS`. If it's not found, return `false`."""
return os.environ.get("USE_PACKED_CHARMS", "false").replace('"', "")

@pytest.mark.abort_on_fail
async def test_build_and_deploy(self, ops_test: OpsTest, use_packed_charms):
"""Deploy kfp-persistence with required charms and relations."""