-
Notifications
You must be signed in to change notification settings - Fork 12
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: use cache built charms in bundle tests #662
ci: use cache built charms in bundle tests #662
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @NohaIhab ! Tiny comments, other than that lgtm.
update_charm_context(context, charm, cached_charm) | ||
# Otherwise build the charms with ops_test | ||
else: | ||
charms_to_build = { | ||
charm: Path(CHARM_PATH_TEMPLATE.format(basedir=str(basedir), charm=charm)) | ||
for charm in KFP_CHARMS | ||
} | ||
log.info(f"Building charms for: {charms_to_build}") | ||
built_charms = await ops_test.build_charms(*charms_to_build.values()) | ||
log.info(f"Built charms: {built_charms}") | ||
|
||
for charm, charm_file in built_charms.items(): | ||
charm_resources = get_resources_from_charm_file(charm_file) | ||
context.update([(f"{charm.replace('-', '_')}_resources", charm_resources)]) | ||
context.update([(f"{charm.replace('-', '_')}", charm_file)]) | ||
|
||
# Build charms sequentially | ||
for charm_name, charm_path in charms_to_build.items(): | ||
log.info(f" Building charm {charm_name}") | ||
built_charm = await ops_test.build_charm(charm_path) | ||
update_charm_context(context, charm_name, built_charm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local build will now be different from the CI because it's using charmcraft, as opposed to the CI using charmcraftcache. We could approach this by telling developers to pack the charms with charmcraftcache locally before running the tests and passing --charms-path
, although I can see the prerequisite being a bit annoying. WDYT @DnPlas ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have this information on the integration tests README.md. I wouldn't consider it a pre-requisite, but an option:
## Testing locally
Option A - Build charms with charmcraft
<test instructions and a tiny explanation of what's happening>
Option B - Build charms with ccc
<test instructions and a tiny explanation of what's happening>
<tox -ve integration -- --charms-path >
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @NohaIhab !
Closes #654
This PR deprecates the
--no-build
option, that was used to deploy the charms from Charmhub and test them locally due to it not being used by the team.Summary
--charms-path
parameter to pass to integration testsNote to reviewer:
the single charm integration tests are failing due to canonical/kubeflow-ci#152, this should be fixed by #663