Skip to content

Commit

Permalink
Merge branch 'main' into issues/1215
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Aug 22, 2023
2 parents 9d6a5c9 + 5945332 commit a5e8840
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
1 change: 1 addition & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ prepare: |
fi
tests.pkgs install snapd
tests.pkgs install unzip
snap wait system seed.loaded
Expand Down
39 changes: 30 additions & 9 deletions tests/spread/charms/bundle/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,32 @@ kill-timeout: 60m

environment:
BUNDLE/argo: https://github.com/canonical/argo-operators
# Needs a different workflow for now, but a target for later enabling.
# BUNDLE/cos_lite: https://github.com/canonical/cos-lite-bundle
BUNDLE/cos_lite: https://github.com/canonical/cos-lite-bundle
BUNDLE/istio: https://github.com/canonical/istio-operators
BUNDLE/kfp: https://github.com/canonical/kfp-operators
# Needs a different workflow
# BUNDLE/kubeflow: https://github.com/canonical/bundle-kubeflow
BUNDLE/kubeflow: https://github.com/canonical/bundle-kubeflow
BUNDLE/notebook_operators: https://github.com/canonical/notebook-operators

prepare: |
git clone --depth=1 "${BUNDLE}" bundle
pushd bundle
# Create bundle.yaml file for bundles (e.g. cos-lite) that require it.
if [ -f "render_bundle.py" ]; then
./render_bundle.py bundle.yaml
touch .do_not_diff_bundle
fi
# Get the bundle.yaml if necessary (e.g. for kubeflow)
if [ -f "releases/latest/edge/bundle.yaml" ]; then
cp releases/latest/edge/bundle.yaml .
touch .do_not_diff_bundle
fi
popd
restore: |
for directory in $(ls -1 bundle/charms); do
pushd "bundle/charms/${directory}"
Expand All @@ -34,11 +49,17 @@ execute: |
# Ensure that the output bundle.yaml file is the same as the bundle.yaml file
# within the bundle itself.
unzip -p *.zip bundle.yaml | diff -s output_bundle.yaml -
# Ensure at least one charm file is referenced in the bundle.yaml
test $(grep "charm: ${PWD}" output_bundle.yaml | wc -l) -ge 1
# Ensure all local charms referenced in the bundle exist
grep "charm: ${PWD}" output_bundle.yaml | cut -d: -f2 | xargs file -E
if [ ! -e .do_not_diff_bundle ]; then
unzip -p *.zip bundle.yaml | diff -s output_bundle.yaml -
fi
# Tests only needed if the bundle has contained charms rather than store charms
if [ -d charms ]; then
# Ensure at least one charm file is referenced in the bundle.yaml
test $(grep "charm: ${PWD}" output_bundle.yaml | wc -l) -ge 1
# Ensure all local charms referenced in the bundle exist
grep "charm: ${PWD}" output_bundle.yaml | cut -d: -f2 | xargs file -E
fi
# Test deploying the bundle.
# TODO: install juju on the runner and re-enable this.
Expand Down

0 comments on commit a5e8840

Please sign in to comment.