Skip to content

Implement testEnv for e2e tests#1697

Merged
stefanprodan merged 1 commit intofluxcd:mainfrom
chanwit:e2e_install
Aug 16, 2021
Merged

Implement testEnv for e2e tests#1697
stefanprodan merged 1 commit intofluxcd:mainfrom
chanwit:e2e_install

Conversation

@chanwit
Copy link
Contributor

@chanwit chanwit commented Aug 7, 2021

This PR implements multiple test modes for e2e.
In addition to fakeKubeManager, we add 2 modes of testEnv:

  • testEnv's controlplane only, and
  • the existing cluster mode

This PR also implements 2 test cases for flux install and flux install --component-extras using the existing cluster mode.

Signed-off-by: Chanwit Kaewkasi chanwit@gmail.com

@chanwit chanwit force-pushed the e2e_install branch 2 times, most recently from 058cf5b to 83fa78b Compare August 7, 2021 18:43
@allenporter
Copy link
Contributor

Would it make sense to always run under testEnv and remove usage of the fake? Generally I saw that it seems to be preferred and better supported over the fake client, but wasn't sure if there were large down sides (e.g. super slow)

@chanwit
Copy link
Contributor Author

chanwit commented Aug 8, 2021 via email

@allenporter
Copy link
Contributor

I'm supporting all possible modes at the moment because fake is still useful in many cases, and I still don't want to break flow of unit tests here and there. We could gradually remove fake tests over time as we see fit, wdyt?

On Sun, Aug 8, 2021, 1:54 AM Allen Porter @.***> wrote: Would it make sense to always run under testEnv and remove usage of the fake? Generally I saw that it seems to be preferred and better supported over the fake client, but wasn't sure if there were large down sides (e.g. super slow) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#1697 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACTKW4KC36KDBDOBOSDFLT3V6PHANCNFSM5BXUHWYQ .

I only added these fake unit tests a few days ago, so, if the env test works just as good happy to switch. I'm happy to try it out and then update and remove, just figured you might have a better idea of it's it's worth it just to switch all at once.

@chanwit chanwit requested a review from stefanprodan August 8, 2021 06:57
@chanwit chanwit changed the title implement testEnv for e2e tests [WIP] implement testEnv for e2e tests Aug 12, 2021
@chanwit chanwit force-pushed the e2e_install branch 2 times, most recently from d10c32d to c0e4315 Compare August 12, 2021 15:33
@chanwit
Copy link
Contributor Author

chanwit commented Aug 12, 2021

@stefanprodan We don't have testEnv v1.21.1.

unable to fetch checksum for requested version: unable fetch metadata for kubebuilder-tools-1.21.1-linux-amd64.tar.gz -- got status "404 Not Found" from GCS

@stefanprodan
Copy link
Member

@stefanprodan
Copy link
Member

Looks like we need to add the Kubernetes version to out action, as described here https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest

@stefanprodan
Copy link
Member

@chanwit I figure it out, please set the version to 1.21.x

@chanwit chanwit force-pushed the e2e_install branch 5 times, most recently from 5639368 to edb8ae0 Compare August 13, 2021 06:15
@chanwit chanwit requested a review from stefanprodan August 13, 2021 06:39
@chanwit
Copy link
Contributor Author

chanwit commented Aug 13, 2021

It seems to be working at a certain level.
https://github.com/fluxcd/flux2/runs/3319357290?check_suite_focus=true#step:10:1

@stefanprodan could you please take a look

@chanwit chanwit changed the title [WIP] implement testEnv for e2e tests implement testEnv for e2e tests Aug 13, 2021
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @chanwit 🥇

@stefanprodan stefanprodan changed the title implement testEnv for e2e tests Implement testEnv for e2e tests Aug 16, 2021
@stefanprodan stefanprodan merged commit cec8b53 into fluxcd:main Aug 16, 2021
@allenporter
Copy link
Contributor

I'm updating #1696 now that this is merged and was curious since it was not immediately obvious when reading the test: What are the sleeps for? I was curious if we could explicitly wait for the condition it is expecting, but wasn't sure what the context was.

@stefanprodan
Copy link
Member

@allenporter there are many issues with the current install testing, as the namespace finalizer can take anywhere from 1 to 5 minutes :( I will get rid of the sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants