This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
End-to-end test for garbage collection #2577
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
squaremo
changed the title
End-to-end test for garbage collection
[WIP] End-to-end test for garbage collection
Nov 4, 2019
2opremio
reviewed
Nov 4, 2019
test/e2e/lib/install.bash
Outdated
# This generates the base descriptions, which we'll then patch with a kustomization | ||
$fluxctl_install_cmd --namespace "${FLUX_NAMESPACE}" -o "${kustomtmp}" 2>&3 | ||
cp ${E2E_DIR}/fixtures/{kustomization,e2e_patch}.yaml "${kustomtmp}/" | ||
kubectl apply -k "${kustomtmp}" >&3 |
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.
Nice!!
squaremo
changed the title
[WIP] End-to-end test for garbage collection
End-to-end test for garbage collection
Nov 5, 2019
hiddeco
reviewed
Nov 5, 2019
2opremio
reviewed
Nov 5, 2019
This changes the `fluxctl install` installation to use a kustomization, rather than sed. This is a little more robust; but the motivation is more that it will enable more complicated patches, like mounting volumes. _En passant_, the kubectl rollout during flux installation gets a timeout, so it can fail fast. Well, faster than twenty minutes.
This adds the ability to give an alternate kustomization when installing flux, and uses that to test flux with garbage collection.
The test runner `bats` installs its own trap(s), and in doing so, appears to interfere with the trap `defer.bash` sets. So, instead of setting the trap within the sourced file, require the deferred-command-runner to be invoked explicitly. `run.bash` can set a trap to do so; the tests must call `run_deferred` (formerly `on_exit`) in their teardown function.
squaremo
commented
Nov 6, 2019
mkdir "${kustomtmp}/base" | ||
# This generates the base manifests, which we'll then patch with a kustomization | ||
echo ">>> writing base configuration to ${kustomtmp}" >&3 | ||
echo ">>> writing base configuration to ${kustomtmp}/base" >&3 |
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.
Related, just, to the change immediately above.
hiddeco
approved these changes
Nov 6, 2019
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.
💯 for using teardown
as an alternative trap.
2opremio
added a commit
to 2opremio/flux
that referenced
this pull request
Nov 8, 2019
fluxcd#2577 introduced a regression, ( at https://github.com/fluxcd/flux/pull/2577/files#diff-e76b06a8940cf68dbf66b91380d3dc28L58 ) causing the end-to-end tests to use the latest Flux release instead of the local version.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a test for syncing with garbage collection switched on. To make it easier to add arbitrary arguments to the flux deployment, it also adds a mechanism for turning the output of
fluxctl install
into a kustomization and patching it.