Skip to content

[DRAFT] Nikhil/integration test poc #63

[DRAFT] Nikhil/integration test poc

[DRAFT] Nikhil/integration test poc #63

name: Helm Charts Agent - Integration Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
#Special permissions required for OIDC authentication
permissions:
id-token: write
contents: write
pull-requests: write
env:
TF_VAR_observe_url: ${{secrets.OBSERVE_URL}}
TF_VAR_observe_token: ${{secrets.OBSERVE_TOKEN}}
jobs:
helm-charts-agent-integration-tests:
name: helm-charts-agent-integration-tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: integration #Terrafrom commands and tests are ran from integration directory
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: |
cat /proc/cpuinfo
cat /proc/meminfo
lspci
- uses: azure/setup-kubectl@v4
with:
version: latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install -r scripts/requirements.txt
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.8.5
# - name: Terraform Init
# working-directory: integration/modules/setup_kind_cluster
# id: init
# run: terraform init
# - name: Terraform Validate
# working-directory: integration/modules/setup_kind_cluster
# id: validate
# run: terraform validate -no-color
- name: Terraform Apply
working-directory: integration/modules/local_sandbox
id: tf-apply
run: |
echo $KUBECONFIG
terraform init
terraform apply --auto-approve
sleep 10
- name: Debug
if: always()
run: |
echo $KUBECONFIG
kubectl logs -l app.kubernetes.io/name=daemonset-logs-metrics --namespace=observe --all-containers=true --timestamps
kubectl get pods --namespace=observe
kubectl events --namespace=observe
kubectl describe deployments --namespace=observe
kubectl describe pods --namespace=observe
kubectl describe nodes --namespace=observe
# - name: Terraform Apply
# working-directory: integration/modules/setup_kind_cluster
# id: tf-apply
# run: |
# terraform init
# terraform apply --auto-approve
# sleep 10
# kubectl get nodes
# kubectl describe nodes
# kubectl get namespaces
# - name: Terraform Apply 2
# working-directory: integration/modules/deploy_helm
# id: tf-apply-2
# run: |
# kubectl config view
# kubectl config current-context
# # terraform init
# # terraform apply --auto-approve
# # sleep 20
# # kubectl config set-context --current --namespace=observe
# #
# - name: Terraform Test
# id: test
# run: |
# terraform test -verbose