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

Implement EKS E2E Testing Workflow #1445

Merged
merged 39 commits into from
Dec 16, 2024
Merged

Implement EKS E2E Testing Workflow #1445

merged 39 commits into from
Dec 16, 2024

Conversation

musa-asad
Copy link
Contributor

@musa-asad musa-asad commented Dec 2, 2024

Description of the issue

We aim to enhance our testing framework to support end-to-end testing of various helm-charts values and allow the use of custom branches for the agent, operator, and helm-charts repositories to enable testing of different configurations and prevent regressions to verify Kubernetes resource creation/deletion and metric emission.

Description of changes

Co-PR: aws/amazon-cloudwatch-agent-test#434.

Important

Updated build-test-artifacts.yml due to failing workflow run, which tried to run the integration tests: View Workflow Run #12324314762. It isn't problematic to include this as an option.

  • Implemented e2e-test.yml workflow to run end-to-end tests with configurable inputs for region, operator_branch, and helm_charts_branch.
  • Moved e2e-build.yml into e2e-test.yml to prevent calling more than three nested workflows.
  • Implemented eks-e2e-test.yml as a reusable workflow for EKS cluster Terraform creation.
  • Created GenerateTestMatrix job, similar to the one in integration-test.yml, to generate test configurations using a Go generator script from the amazon-cloudwatch-agent-test repository.

An example job for the re-usable workflow:

  EKSE2EJVMTomcatTest:
    needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
    name: 'EKSE2EJVMTomcatTest'
    uses: ./.github/workflows/eks-e2e-test.yml
    with:
      terraform_dir: terraform/eks/e2e
      job_id: eks-e2e-jvm-tomcat-test
      test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_matrix }}
      test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }}
      test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
      test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
      cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
      cloudwatch_agent_tag: ${{ github.sha }}
      cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
      cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
      region: ${{ inputs.region }}
      helm_charts_branch: ${{ inputs.helm-charts-branch }}
      terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
      agent_config: resources/cwagent_configs/jvm_tomcat.json
      sample_app: resources/sample_apps/tomcat-deployment.yaml
    secrets: inherit

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Workflow Status
View Workflow Run #12337417856

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@musa-asad musa-asad changed the title Implement E2E testing framework workflow. Implement E2E testing framework for EKS Dec 2, 2024
@musa-asad musa-asad changed the title Implement E2E testing framework for EKS Implement E2E testing workflow for EKS Dec 2, 2024
@musa-asad musa-asad changed the title Implement E2E testing workflow for EKS Implement E2E Testing Workflow for EKS Dec 2, 2024
@musa-asad musa-asad marked this pull request as ready for review December 2, 2024 04:09
@musa-asad musa-asad requested a review from a team as a code owner December 2, 2024 04:09
@musa-asad musa-asad removed the request for review from Paramadon December 2, 2024 04:16
@musa-asad musa-asad self-assigned this Dec 2, 2024
@musa-asad musa-asad changed the title Implement E2E Testing Workflow for EKS Implement EKS E2E Testing Workflow Dec 2, 2024
Copy link
Contributor

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

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

minor comments

.github/workflows/e2e-test.yml Show resolved Hide resolved
.github/workflows/e2e-test.yml Show resolved Hide resolved
.github/workflows/eks-e2e-test.yml Show resolved Hide resolved
.github/workflows/eks-e2e-test.yml Show resolved Hide resolved
.github/workflows/integration-test.yml Outdated Show resolved Hide resolved
dricross
dricross previously approved these changes Dec 13, 2024
Copy link
Contributor

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

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

This looks good, but would like to see it tested with the test repo after, the test repo is merged

@musa-asad musa-asad merged commit 2a7f43b into main Dec 16, 2024
28 checks passed
@musa-asad musa-asad deleted the e2e branch December 16, 2024 20:42
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