-
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
Feat E2E CI and an exectuable #10
base: master
Are you sure you want to change the base?
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.
Unfinished review, sorry for sending it too quickly.
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.
Please see comments above.
e2e/e2e.sh
Outdated
ROOT=$(git rev-parse --show-toplevel) #get root of git repo | ||
QUOTACLAIM='resourcequotaclaims.cagip.github.com' | ||
|
||
#clean up function. If you want to totaly remove kotary after test, uncomment the lines |
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.
This should probably be a trap.
kubectl apply -f $ROOT/e2e/KotaryService/ConfigMap.yaml -n kube-system | ||
|
||
kubectl create ns $NS | ||
while ! kubectl get pods -n kube-system | grep kotary | grep Running > /dev/null ; do echo -e "${BLUE}.... Waiting for Kotary pod to be Running ....${NC}" ; sleep 2; done |
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.
nit: You could use a different command to ensure 1/1 are running, but this is fine for me.
e2e/e2e.sh
Outdated
kubectl apply -f $ROOT/e2e/KotaryService/QuotaClaim.yaml -n $NS && sleep 3 | ||
echo -e "${GREEN} -- OK --${NC}\\n" | ||
|
||
#echo -e "\\n ${PURPLE}-- Adding a pod with bad image --> should not impact the ressources used --${NC}" && sleep 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.
can you remove this?
@@ -0,0 +1,94 @@ | |||
#!/bin/bash | |||
|
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.
I think the tests should stop on first error, and throw a recap.
you should probably:
- set -o errexit,pipefail
- use a trap (see comment below)
- add the "recap" of the tests who succeeded/failed in the trap.
After that (and the indentation issues), I think we can merge up this script. In the future, I think it might be more robust to use a different test framework than a self made bash script. (Either a test framework in bash, or a golang test).
ba224df
to
ffe1829
Compare
Features a new e2e CI based on a bash script. the script makes some tests to verify that the operator is working as intended. It does not go into really deep tests, this is a way to simulate how a classic user would use kotary. Mainly used to verify that the operator is working fine.
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.
A few last minute things to clean up.
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: "kindest/node:v1.25.11" |
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.
highly confusing.
.github/workflows/e2eCI.yaml
Outdated
|
||
- name: testing cluster kinD | ||
run: | | ||
kubectl cluster-info --context kind-chart-testing echo " current-context:" $(kubectl config current-context) |
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.
you seme to be using kind-chart-testing or chart-testing... yet:
there is no helm chart testing, and there is no chart-testing name in the config of the cluster.
.github/workflows/e2eCI.yaml
Outdated
- name: testing cluster kinD | ||
run: | | ||
kubectl cluster-info --context kind-chart-testing echo " current-context:" $(kubectl config current-context) | ||
kubectl get all --all-namespaces |
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.
not necessary.
.github/workflows/e2eCI.yaml
Outdated
|
||
- name: Docker Build image | ||
run: | | ||
docker build -t "ci/kotary:${{ matrix.kubernetes }}" . |
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.
this is confusing. When multiple jobs will run together, they will override each other. Let's include a sha.
Without this, 1.24 is deploying 1.25, and the CI would actually fail.
Created a e2e CI to test the basic functionment of the Kotary operator.
This CI runs when you push a commit. It builds an image from the current files of the repository and run it in a Kind cluster. Then it uses a bash script to make an basic e2e test to verify that everything still works as intended.
The CI test the operator for versions 1.21, 23, 24, and 26 of kubernetes.
The e2e.sh script can also be drectly used if you are already connected to a kubernetes cluster. Be careful, the script run the tests ,using the version of kotary referenced in the deployment.yaml manifest. If you want to test your modifications you will have to build your own image, push it to dockerhub and modify the manifest accordingly.