You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flux2/tests/integration
Somtochi Onyekwere 271281e651 Move tests to seperate repository 3 years ago
..
terraform/azure Move tests to seperate repository 3 years ago
testdata Move tests to seperate repository 3 years ago
.env.sample Move tests to seperate repository 3 years ago
Makefile Move tests to seperate repository 3 years ago
README.md Move tests to seperate repository 3 years ago
azure_specific_test.go Move tests to seperate repository 3 years ago
azure_test.go Move tests to seperate repository 3 years ago
flux_test.go Move tests to seperate repository 3 years ago
go.mod Move tests to seperate repository 3 years ago
go.sum Move tests to seperate repository 3 years ago
image_repo_test.go Move tests to seperate repository 3 years ago
oci_test.go Move tests to seperate repository 3 years ago
sops_encryption_test.go Move tests to seperate repository 3 years ago
suite_test.go Move tests to seperate repository 3 years ago
util_test.go Move tests to seperate repository 3 years ago

README.md

Azure E2E

E2E tests for Azure are needed to mitigate introduction of new bugs in dependencies like libgit2. The goal is to verify that Flux integration with Azure services are actually working now and in the future.

Architecture

The aks Terraform creates the AKS cluster and related resources to run the tests. It creates the AKS cluster, Azure DevOps repositories, Key Vault Key for Sops, Azure container registries and Azure EventHub. The resources should be created and destroyed before and after every test run.

Requirements

  • Azure account with an active subscription to be able to create AKS and ACR, and permission to assign roles. Role assignment is required for allowing AKS workloads to access ACR.
  • Azure CLI, need to be logged in using az login.
  • Docker CLI for registry login.
  • kubectl for applying certain install manifests.

Tests

Each test run is initiated by running terraform apply on the aks Terraform, it does this by using the tftestenv package within the fluxcd/test-infra repository. It then reads the output of the Terraform to get credentials and ssh keys, this means that a lot of the communication with the Azure API is offset to Terraform instead of requiring it to be implemented in the test.

The following tests are currently implemented:

  • Flux can be successfully installed on AKS using the CLI e.g.:
  • source-controller can clone Azure DevOps repositories (https+ssh)
  • image-reflector-controller can list tags from Azure Container Registry image repositories
  • kustomize-controller can decrypt secrets using SOPS and Azure Key Vault
  • image-automation-controller can create branches and push to Azure DevOps repositories (https+ssh)
  • notification-controller can send commit status to Azure DevOps
  • notification-controller can forward events to Azure Event Hub
  • source-controller can pull charts from Azure Container Registry Helm repositories

Running these tests locally

  1. Copy .env.sample to .env and add the values for the different variables which includes. - your Azure DevOps org, personal access tokens and ssh keys for accessing repositories on Azure DevOps org. Run source .env.
  2. Run make test-azure