Skip to content
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

ci: add basic integration testing framework #199

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

obs-gh-nikhildua
Copy link
Contributor

@obs-gh-nikhildua obs-gh-nikhildua commented Aug 29, 2024

  • Add "integration" folder which contains basic Integration testing framework
  • Adds basic CI workflow for helm charts agent - integration tests
  • Next iteration of this will contain real python tests against the cluster/helm-charts. Currently this performs a crude smoke test to ensure our helm-chart can be successfully installed in a cluster on any given commit in the PR process

Description

The location (helm-charts/integration) is intended to run integration tests using the terraform test framework both locally and in CI the exact same way.

The tests are run from the location using the terraform test -verbose command.

The tests ran are those located in the helm-charts/integrations/tests location as hcl files

The current agent-default.tftest.hcl file contains a basic integration test that will do the following in sequence

  • Setup a local kind cluster (using docker) with one master node and two worker nodes. This uses the integration/modules/setup_kind_cluster module
  • Install our agent helm chart charts/agent with default values (integration/modules/deploy_helm/values/default.yaml). This uses the integration/modules/deploy_helm module
  • Runs a python script (scripts/test_basic.py) using pytest/kubeclient framework to check if all deployed agent pods are ready

Note: Since the helm chart deployment automatically waits until all pods are in READY state (within the timeout), the initial test in redundant. If a helm chart deployment fails, the python tests themselves will run to provide more information on what failed (eg: why the pods weren't READY within desired timeout)

Other modules (such as setup_aws_*) are not used in integration testing yet but the foundation for future real-cluster testing is setup when a deployment is needed in EKS.

Local Testing:

These tests can also be ran locally. See integration/README.md

@obs-gh-nikhildua obs-gh-nikhildua force-pushed the nikhil/add-basic-integration-testing branch from d70c63a to 0a3c2a3 Compare August 29, 2024 18:27
@obs-gh-nikhildua obs-gh-nikhildua marked this pull request as ready for review August 29, 2024 18:38
@obs-gh-alexlew
Copy link
Contributor

lgtm, not sure why all the AKS stuff is going in with this PR if that parts not ready yet but don't mind it really. just would make more sense for all of that to go in together

@obs-gh-alexlew
Copy link
Contributor

where does the kind cluster run? on an ec2 instance? or on the actual docker runner?

@obs-gh-nikhildua obs-gh-nikhildua force-pushed the nikhil/add-basic-integration-testing branch from 0a3c2a3 to 8b41f24 Compare August 29, 2024 20:35
@obs-gh-nikhildua
Copy link
Contributor Author

Other modules (such as setup_aws_*) are not used in integration testing yet but the foundation for future real-cluster testing is setup when a deployment is needed in EKS.

I merged them in anyways since I had started off building the PoC with that but diverted to kind cluster instead. This just gives us the option to deploy to EKS at any time by anyone when needed without setting up a new cluster.

I can see it being later for more "real-world" e2e testing

@obs-gh-nikhildua
Copy link
Contributor Author

where does the kind cluster run? on an ec2 instance? or on the actual docker runner?

It runs on the github actions machine itself. it sets up 2 docker containers for worker nodes and 1 container for master node

@obs-gh-nikhildua obs-gh-nikhildua force-pushed the nikhil/add-basic-integration-testing branch from 7d2ae2e to 72167a2 Compare August 29, 2024 21:57
@obs-gh-nikhildua obs-gh-nikhildua merged commit 2da0abb into main Aug 29, 2024
8 checks passed
@obs-gh-nikhildua obs-gh-nikhildua deleted the nikhil/add-basic-integration-testing branch August 29, 2024 23:16
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.

2 participants