Skip to content

Prepare v6.0 and new CI pipeline.#241

Merged
lonegunmanb merged 11 commits intoAzure:masterfrom
lonegunmanb:ci
Sep 13, 2022
Merged

Prepare v6.0 and new CI pipeline.#241
lonegunmanb merged 11 commits intoAzure:masterfrom
lonegunmanb:ci

Conversation

@lonegunmanb
Copy link
Copy Markdown
Member

This is a major version upgrade and it mainly focus on adding a new CI pipeline to this repo so we can speed up our code review and enforce a high code quality standard.

It also split original test fixture folder into three so we can demonstrate different use cases.

@zioproto
Copy link
Copy Markdown
Contributor

zioproto commented Sep 8, 2022

This is how I checked this PR:

git fetch origin pull/241/head:pr241
git checkout pr241
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make pre-commit
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make pr-check
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make e2e-test

the e2e test is failing for me.

TestExamplesStartup 2022-09-08T13:21:45Z retry.go:91: terraform [apply -input=false -auto-approve -var client_id= -var client_secret= -lock=false]
TestExamplesStartup 2022-09-08T13:21:45Z logger.go:66: Running command terraform with args [apply -input=false -auto-approve -var client_id= -var client_secret= -lock=false]
TestExamplesStartup 2022-09-08T13:22:01Z logger.go:66: data.curl.public_ip[0]: Reading...
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: data.curl.public_ip[0]: Read complete after 0s [id=1662643322]
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: ╷
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │ Warning: Argument is deprecated
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   with azurerm_subnet.test,
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   on main.tf line 31, in resource "azurerm_subnet" "test":
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   31:   enforce_private_link_endpoint_network_policies = true
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │ `enforce_private_link_endpoint_network_policies` will be removed in favour
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │ of the property `private_endpoint_network_policies_enabled` in version 4.0
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │ of the AzureRM Provider
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: ╵
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: ╷
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │ Error: building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: launching Azure CLI: exec: "az": executable file not found in $PATH.
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   with provider["registry.terraform.io/hashicorp/azurerm"],
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   on providers.tf line 18, in provider "azurerm":
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │   18: provider "azurerm" {
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: │
TestExamplesStartup 2022-09-08T13:22:02Z logger.go:66: ╵
TestExamplesStartup 2022-09-08T13:22:02Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: launching Azure CLI: exec: "az": executable file not found in $PATH.
│
│   with provider["registry.terraform.io/hashicorp/azurerm"],
│   on providers.tf line 18, in provider "azurerm":
│   18: provider "azurerm" {
│
╵}
    apply.go:15:
        	Error Trace:	/src/test/e2e/apply.go:15
        	            				/src/test/e2e/e2etest.go:21
        	            				/src/test/e2e/terraform_aks_test.go:22
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; ╷
        	            	│ Error: building AzureRM Client: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: launching Azure CLI: exec: "az": executable file not found in $PATH.
        	            	│
        	            	│   with provider["registry.terraform.io/hashicorp/azurerm"],
        	            	│   on providers.tf line 18, in provider "azurerm":
        	            	│   18: provider "azurerm" {
        	            	│
        	            	╵}
        	Test:       	TestExamplesStartup
TestExamplesStartup 2022-09-08T13:22:02Z retry.go:91: terraform [destroy -auto-approve -input=false -var client_id= -var client_secret= -lock=false]

@zioproto
Copy link
Copy Markdown
Contributor

zioproto commented Sep 8, 2022

Do we actually need az in the container ? Now it is not there:

% docker run -ti --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest /bin/bash
root@53188d41e7b6:/src# az
bash: az: command not found

@zioproto
Copy link
Copy Markdown
Contributor

I understand now that because I was not passing the ARM_.... variables in the command line the e2e was failing.

I tested the e2e tests like this:

time docker run --rm -v $(pwd):/src -w /src -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e ARM_CLIENT_SECRET mcr.microsoft.com/azterraform:latest make e2e-test

all tests passed:

PASS
ok  	github.com/Azure/terraform-azurerm-aks/e2e	4931.476s

Copy link
Copy Markdown
Contributor

@zioproto zioproto left a comment

Choose a reason for hiding this comment

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

LGTM

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