github.com/Azure/aad-pod-identity@v1.8.17/.pipelines/templates/e2e-test.yml (about) 1 parameters: 2 - name: clusterConfigs 3 type: object 4 - name: buildPlatforms 5 type: string 6 default: linux/amd64,linux/arm64 7 8 jobs: 9 - ${{ each clusterConfig in parameters.clusterConfigs }}: 10 - job: 11 displayName: ${{ format('{0}', clusterConfig) }} 12 dependsOn: 13 - scan_images 14 - lint 15 - unit_test 16 timeoutInMinutes: 120 17 cancelTimeoutInMinutes: 5 18 workspace: 19 clean: all 20 variables: 21 - group: aad-pod-identity 22 - name: CLUSTER_CONFIG 23 value: ${{ format('{0}', clusterConfig) }} 24 - name: BUILD_PLATFORMS 25 value: ${{ parameters.buildPlatforms }} 26 steps: 27 - template: az-login.yml 28 29 - template: install-helm.yml 30 31 - template: build-images.yml 32 33 - script: | 34 RESOURCE_GROUP="aad-pod-identity-e2e-$(openssl rand -hex 2)" 35 echo "##vso[task.setvariable variable=RESOURCE_GROUP]${RESOURCE_GROUP}" 36 displayName: "Generate resource group name" 37 38 - ${{ if eq(clusterConfig, 'aks') }}: 39 - template: deploy-aks-cluster.yml 40 41 - template: role-assignment.yml 42 parameters: 43 identity_resource_group: $(IDENTITY_RESOURCE_GROUP) 44 keyvault_resource_group: $(IDENTITY_RESOURCE_GROUP) 45 46 - script: | 47 kubectl wait --for=condition=ready node --all 48 kubectl wait pod -n kube-system --for=condition=Ready --all 49 kubectl get nodes -owide 50 kubectl cluster-info 51 displayName: "Check cluster's health" 52 53 - script: | 54 export REGISTRY="${REGISTRY:-$(REGISTRY_NAME).azurecr.io/k8s/aad-pod-identity}" 55 export MIC_VERSION="${IMAGE_VERSION}" 56 export NMI_VERSION="${IMAGE_VERSION}" 57 export IDENTITY_VALIDATOR_VERSION="${IMAGE_VERSION}" 58 make e2e 59 env: 60 # used by 'When deploying service principal should pass the identity validation' test case 61 SERVICE_PRINCIPAL_CLIENT_ID: $(SERVICE_PRINCIPAL_CLIENT_ID) 62 SERVICE_PRINCIPAL_CLIENT_SECRET: $(SERVICE_PRINCIPAL_CLIENT_SECRET) 63 displayName: "Run E2E tests" 64 65 - template: cleanup-role-assignments.yml 66 67 - script: | 68 if [[ "${CLUSTER_CONFIG}" == "aks" ]]; then 69 az aks delete -g ${RESOURCE_GROUP} -n ${RESOURCE_GROUP} --yes --no-wait 70 fi 71 az group delete -g ${RESOURCE_GROUP} --yes --no-wait 72 condition: always() 73 displayName: "Delete resource group and role assignments" 74 75 - template: cleanup-images.yml