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

ci, tests: pass charm artefacts to deploy and test charms #640

Merged

Conversation

DnPlas
Copy link
Contributor

@DnPlas DnPlas commented Dec 17, 2024

This commit enables the "--charm-path" option to pass .charm artefacts
to be deployed and tested at an individual level.
This change enables the option to pass pre-built charms to the tests
to avoid building them on the same test. It also ensures compatibility
with the build_charm.py reusable workflow (from canonical/data-platform-workflows).

Fixes: #639

Review and merge after #642, and canonical/charmed-kubeflow-workflows#90

@DnPlas DnPlas force-pushed the KF-6696-use-charm-artefacts-individual branch 2 times, most recently from f8108f1 to be89868 Compare December 17, 2024 22:50
@DnPlas DnPlas changed the title skip: debug ci, tests: pass charm artefacts to deploy and test charms Dec 17, 2024
@DnPlas DnPlas force-pushed the KF-6696-use-charm-artefacts-individual branch from 09f67cb to 7e97d95 Compare December 17, 2024 23:32
@DnPlas DnPlas changed the base branch from main to KF-6684-refactor-ci-with-build December 17, 2024 23:39
@DnPlas DnPlas force-pushed the KF-6696-use-charm-artefacts-individual branch from 7e97d95 to a425c46 Compare December 17, 2024 23:47
This commit enables the "--charm-path" option to pass .charm artefacts
to be deployed and tested at an individual level.
This change enables the option to pass pre-built charms to the tests
to avoid building them on the same test. It also ensures compatibility
with the build_charm.py reusable workflow (from canonical/data-platform-workflows).

Fixes: #639
@DnPlas DnPlas force-pushed the KF-6696-use-charm-artefacts-individual branch from a425c46 to 57f219b Compare December 17, 2024 23:56
Copy link
Contributor

@orfeas-k orfeas-k left a comment

Choose a reason for hiding this comment

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

Left some comments, good job on keeping it concise!

- name: Integration tests
if: steps.download-charms.outcome == 'success'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Won't it fail by itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe left it by mistake, I can remove it.

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
# Copyright 2024 Canonical Ltd.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 2025? 😄 FYI I saw a discussion that we don't have to update this every year, but rather use the year when the code was created so I guess it would be 2025 here.

def pytest_addoption(parser: Parser):
parser.addoption(
"--charm-path",
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml",
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 the description should not be tied to the CI use ie build_charm.yaml. It is a valid use case in any environment really.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this makes sense to you, it would also make sense to modify the comment below

Keep the option to run the integration tests locally
by building the charm and then deploying

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 have rephrased it to make it more generic.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should avoid formatting this file? This way, it 'll be easier to check for changes during manifests update. Although we could just check the changes in the upstream files, but still, it's kind of an irrelevant change here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will remove it. Was a quick formatting that got incorrectly added.

Copy link
Contributor

Choose a reason for hiding this comment

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

These changes look also unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@DnPlas DnPlas merged commit 9c543d8 into KF-6684-refactor-ci-with-build Jan 9, 2025
91 of 92 checks passed
@DnPlas DnPlas deleted the KF-6696-use-charm-artefacts-individual branch January 9, 2025 13:05
NohaIhab pushed a commit that referenced this pull request Jan 24, 2025
* ci, tests: pass charm artefacts to deploy and test charms

This commit enables the "--charm-path" option to pass .charm artefacts
to be deployed and tested at an individual level.
This change enables the option to pass pre-built charms to the tests
to avoid building them on the same test. It also ensures compatibility
with the build_charm.py reusable workflow (from canonical/data-platform-workflows).

Fixes: #639

Use single (cached) build for integration tests & release

Fix hardcoded path for `platforms` syntax

skip: remove duplicated download-charms

remove workflow dispatch from release.yaml not needed

add description for outputs

rename get charm paths job and channel output

skip: rename job in needs

pin quality checks back to main due to merging canonical/charmed-kubeflow-workflows#95

Use stage instead of prime in charmcraft files part (#658)
NohaIhab added a commit that referenced this pull request Jan 24, 2025
Use single (cached) build for integration tests & release

Fix hardcoded path for `platforms` syntax

remove workflow dispatch from release.yaml not needed

add description for outputs

rename get charm paths job and channel output

pin quality checks back to main due to merging canonical/charmed-kubeflow-workflows#95

Use stage instead of prime in charmcraft files part (#658)

Co-authored-by: Daniela Plascencia <[email protected]>
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.

Use .charm artefacts in individual integraton tests
2 participants