Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

End-to-end test framework scaffold #110

Merged
merged 3 commits into from
Nov 21, 2019
Merged

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Nov 20, 2019

Scaffolding for #103.

This lacks any tooling around working with multiple Helm versions.

@hiddeco hiddeco added enhancement New feature or request build About the build or test scaffolding helm v3 Issue or PR related to Helm v3 labels Nov 20, 2019
@hiddeco hiddeco changed the base branch from master to helm-v3-dev November 20, 2019 19:25
KUBECTL_CHECKSUM_arm=dc60bdf00e6c7806e3c11e4f73e2ff27a603e968f22567d8c87ed5ece04263e557cb0df8d7b5196bc28a96b0b1f8ae104c503e9b9d90ce77c25e85954b54e178
KUBECTL_CHECKSUM_arm64=00a98acd51107d1cb935cfc07ca31487290412f92ac34a91ec8c7f4b802bf798a7cc9cac22978a92001641c3c99a651c7f9a9f7f64f7cc4839a9d26021667a3b

KUBECTL_VERSION=v1.14.9
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the version bump intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it even has a dedicated commit (5cccc11). The previous version did not support kubectl apply -k.

# The gitconfig secret must exist and have the right value
poll_until_equals "gitconfig secret" "${GITCONFIG}" "kubectl get secrets -n ${E2E_NAMESPACE} gitconfig -ojsonpath={..data.gitconfig} | base64 --decode"

poll_until_true "namespace $DEMO_NAMESPACE" "kubectl describe ns/$DEMO_NAMESPACE"
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this testing tiller instead of the helm operator? I would instead check with the helm client that the release is made

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, the releases are applied below, so I would simply remove this

kubectl apply -f "$FIXTURES_DIR/releases" >&3

poll_until_true 'podinfo-helm-repository HelmRelease' 'kubectl -n demo get helmrelease/podinfo-helm-repository | grep -e "deployed"'
poll_until_true 'podinfo-git HelmRelease' 'kubectl -n demo describe helmrelease/podinfo-git | grep -e "deployed"'
Copy link
Contributor

@2opremio 2opremio Nov 21, 2019

Choose a reason for hiding this comment

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

Doesn't this simply test that the releases were applied? Shouldn't we test that the operator applied them instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it tests that the releases have been made by the operator and were successful, hence the | grep -e "deployed".

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, sorry, I missed that. It would be cleaner to use poll_until_equals though and extracting the status field.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot about the existence of that method while modifying what I copied from Flux. Will use that instead, much better indeed.

@2opremio
Copy link
Contributor

I think we should share the scaffolding with Flux instead of (mostly) duplicating the files.

How about using a common repository and downloading an exported tarball (or even cloning the repo) locally before running the tests? It's a poor man's external library import system, but I think it's better than simply duplicating the files

@hiddeco
Copy link
Member Author

hiddeco commented Nov 21, 2019

@2opremio I think for the small amount of overlap (as only lib/poll.bash and lib/template.bash are 1:1 copies), having duplicates is easier to work with and more flexible than a common repository.

@2opremio
Copy link
Contributor

Uhm, the basic structure of the libraries is still the same, and maybe it could be adapted to have a lower divergence (sharing more code). But I will let you decide :)

Copy link
Contributor

@2opremio 2opremio left a comment

Choose a reason for hiding this comment

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

LGTM. Only a couple of optional change suggestions.

@hiddeco
Copy link
Member Author

hiddeco commented Nov 21, 2019

@2opremio agreed, but to be able to adapt it to have a lower divergence, one first needs to know what they have in common or how they utilize things, which is in my opinion something that will not be clear until both projects have a decent amount of tests.

I can create a follow up issue for #103 (probably on the Flux side of issue tracking) to look into this once the operator has a decent basic test coverage.

Mainly to support `kubectl apply -k`, but also because the current
version is very old and no longer maintained.
@hiddeco hiddeco merged commit 2e352a9 into helm-v3-dev Nov 21, 2019
@hiddeco hiddeco deleted the helm-v3/e2e-scaffold branch November 21, 2019 12:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build About the build or test scaffolding enhancement New feature or request helm v3 Issue or PR related to Helm v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants