Skip to content

Commit

Permalink
ci: fix variable name in e2e PR check (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadarsie committed Nov 15, 2022
1 parent 8bd1287 commit 2497bcf
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 128 deletions.
81 changes: 45 additions & 36 deletions .pipelines/e2e-job-template.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,51 @@
parameters:
name: '' # defaults for any parameters that aren't specified
k8sRelease: ''
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
name: "" # defaults for any parameters that aren't specified
k8sRelease: ""
apimodel: "examples/e2e-tests/kubernetes/release/default/definition.json"
createVNET: false
skipTests: ''
skipTests: ""
regions: ""
subscriptionId: ""
tenantId: ""
clientId: ""
clientSecret: ""
stabilityIterations: 0

jobs:
- job: ${{ parameters.name }}
dependsOn: unit_tests
timeoutInMinutes: 150
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: ubuntu-20.04
- job: ${{ parameters.name }}
dependsOn: unit_tests
timeoutInMinutes: 150
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: ubuntu-20.04
container: dev1

container: dev1
variables:
GOBIN: "$(GOPATH)/bin" # Go binaries path
GOROOT: "/usr/local/go" # Go installation path
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path
TIMEOUT: 30m
CLUSTER_DEFINITION: ${{ parameters.apimodel }}
ORCHESTRATOR_RELEASE: ${{ parameters.k8sRelease }}
CREATE_VNET: ${{ parameters.createVNET }}
CLEANUP_ON_EXIT: true
CLEANUP_IF_FAIL: true
SKIP_TEST: true
GINKGO_SKIP: ${{ parameters.skipTests }}
RETAIN_SSH: false
ENABLE_KMS_ENCRYPTION: ${{ parameters.enableKMSEncryption }}
CONTAINER_RUNTIME: ${{ parameters.containerRuntime }}
BLOCK_SSH: ${{ parameters.runSSHTests }}

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go' # Go installation path
GOPATH: '$(Agent.TempDirectory)/go' # Go workspace path
TIMEOUT: 30m
CLUSTER_DEFINITION: ${{ parameters.apimodel }}
ORCHESTRATOR_RELEASE: ${{ parameters.k8sRelease }}
CREATE_VNET: ${{ parameters.createVNET }}
CLEANUP_ON_EXIT: true
CLEANUP_IF_FAIL: true
GINKGO_SKIP: ${{ parameters.skipTests }}
STABILITY_ITERATIONS: $(E2E_STABILITY_ITERATIONS)
RETAIN_SSH: false
ENABLE_KMS_ENCRYPTION: ${{ parameters.enableKMSEncryption }}
SUBSCRIPTION_ID: '$(SUBSCRIPTION_ID_E2E_KUBERNETES)'
TENANT_ID: '$(TENANT_ID)'
CONTAINER_RUNTIME: ${{ parameters.containerRuntime }}
BLOCK_SSH: ${{ parameters.runSSHTests }}

steps:
- template: e2e-step-template.yaml
parameters:
job: ${{ parameters.name }}
steps:
- template: e2e-step-template.yaml
parameters:
job: ${{ parameters.name }}
regions: ${{ parameters.regions }}
subscriptionId: ${{ parameters.subscriptionId }}
tenantId: ${{ parameters.tenantId }}
clientId: ${{ parameters.clientId }}
clientSecret: '${{ parameters.clientSecret }}'
stabilityIterations: ${{ parameters.stabilityIterations }}
43 changes: 30 additions & 13 deletions .pipelines/e2e-step-template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
parameters:
job: ''
job: ""
regions: ""
subscriptionId: ""
tenantId: ""
clientId: ""
clientSecret: ""
stabilityIterations: 0

steps:
- script: |
Expand All @@ -8,25 +14,36 @@ steps:
shopt -s extglob
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- script: make build-binary
displayName: compile
- script: |
DATE=$(date +%s)
echo "##vso[task.setvariable variable=timestamp]$DATE"
export CLIENT_ID=$(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
export CLIENT_SECRET=$(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)
export AZURE_CORE_ONLY_SHOW_ERRORS=True
export USE_MANAGED_IDENTITY=false
make test-kubernetes
displayName: "Set up the Go workspace"
- script: make build-binary
displayName: compile

- task: Bash@3
displayName: ginkgo k8s e2e tests
inputs:
targetType: "inline"
script: make test-kubernetes
env:
REGIONS: ${{ parameters.regions }}
SUBSCRIPTION_ID: ${{ parameters.subscriptionId }}
TENANT_ID: ${{ parameters.tenantId }}
CLIENT_ID: ${{ parameters.clientId }}
CLIENT_SECRET: '${{ parameters.clientSecret }}'
AZURE_CORE_ONLY_SHOW_ERRORS: true
USE_MANAGED_IDENTITY: false
STABILITY_ITERATIONS: 0

- task: PublishPipelineArtifact@0
inputs:
artifactName: '${{ parameters.job }}-$(timestamp)_logs'
targetPath: './_logs'
artifactName: "${{ parameters.job }}-$(timestamp)_logs"
targetPath: "./_logs"
condition: false

- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: '**/junit.xml'
testResultsFiles: "**/junit.xml"
condition: always()
173 changes: 94 additions & 79 deletions .pipelines/pr-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,102 +1,117 @@
trigger:
branches:
include:
- master
- master
paths:
exclude:
- docs/*
- docs/*

pr:
branches:
include:
- master
- master
paths:
exclude:
- docs/*
- docs/*

resources:
containers:
- container: dev1
image: mcr.microsoft.com/oss/azcu/go-dev:v1.34.7
- container: dev1
image: mcr.microsoft.com/oss/azcu/go-dev:v1.34.7

jobs:
- job: unit_tests
timeoutInMinutes: 60
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: 'Ubuntu 20.04'
- job: unit_tests
timeoutInMinutes: 60
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: "Ubuntu 20.04"

container: dev1
container: dev1

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go' # Go installation path
GOPATH: '$(Agent.TempDirectory)/go' # Go workspace path
REGIONS: ''
SUBSCRIPTION_ID_E2E_KUBERNETES: ''
TENANT_ID: ''
SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES: ''
SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES: ''
variables:
GOBIN: "$(GOPATH)/bin" # Go binaries path
GOROOT: "/usr/local/go" # Go installation path
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path

steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
shopt -s extglob
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- script: make bootstrap
displayName: Install dependencies
- script: make ensure-generated
displayName: Check if generated code is up to date
- script: make generate test-style
displayName: Run linting rules
- script: make build-cross
displayName: Build cross-architectural binaries
- script: make validate-dependencies
displayName: Check if go mod is up-to-date
- script: make test
displayName: Run unit tests
steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
shopt -s extglob
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: "Set up the Go workspace"
- script: make bootstrap
displayName: Install dependencies
- script: make ensure-generated
displayName: Check if generated code is up to date
- script: make generate test-style
displayName: Run linting rules
- script: make build-cross
displayName: Build cross-architectural binaries
- script: make validate-dependencies
displayName: Check if go mod is up-to-date
- script: make test
displayName: Run unit tests

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_22_docker_e2e'
k8sRelease: '1.22'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
createVNET: false
enableKMSEncryption: false
containerRuntime: 'docker'
runSSHTests: true
- template: e2e-job-template.yaml
parameters:
name: "k8s_1_22_docker_e2e"
k8sRelease: "1.22"
apimodel: "examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json"
createVNET: false
enableKMSEncryption: false
containerRuntime: "docker"
runSSHTests: true
regions: $(REGIONS)
subscriptionId: $(SUBSCRIPTION_ID_E2E_KUBERNETES)
tenantId: $(TENANT_ID)
clientId: $(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
clientSecret: $(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_23_docker_e2e'
k8sRelease: '1.23'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
createVNET: false
enableKMSEncryption: false
containerRuntime: 'docker'
runSSHTests: true
- template: e2e-job-template.yaml
parameters:
name: "k8s_1_23_docker_e2e"
k8sRelease: "1.23"
apimodel: "examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json"
createVNET: false
enableKMSEncryption: false
containerRuntime: "docker"
runSSHTests: true
regions: $(REGIONS)
subscriptionId: $(SUBSCRIPTION_ID_E2E_KUBERNETES)
tenantId: $(TENANT_ID)
clientId: $(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
clientSecret: $(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_22_containerd_e2e'
k8sRelease: '1.22'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
createVNET: false
enableKMSEncryption: false
containerRuntime: 'containerd'
runSSHTests: true
- template: e2e-job-template.yaml
parameters:
name: "k8s_1_22_containerd_e2e"
k8sRelease: "1.22"
apimodel: "examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json"
createVNET: false
enableKMSEncryption: false
containerRuntime: "containerd"
runSSHTests: true
regions: $(REGIONS)
subscriptionId: $(SUBSCRIPTION_ID_E2E_KUBERNETES)
tenantId: $(TENANT_ID)
clientId: $(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
clientSecret: $(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_23_containerd_e2e'
k8sRelease: '1.23'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
createVNET: false
enableKMSEncryption: false
containerRuntime: 'containerd'
runSSHTests: true
- template: e2e-job-template.yaml
parameters:
name: "k8s_1_23_containerd_e2e"
k8sRelease: "1.23"
apimodel: "examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json"
createVNET: false
enableKMSEncryption: false
containerRuntime: "containerd"
runSSHTests: true
regions: $(REGIONS)
subscriptionId: $(SUBSCRIPTION_ID_E2E_KUBERNETES)
tenantId: $(TENANT_ID)
clientId: $(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
clientSecret: $(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)

0 comments on commit 2497bcf

Please sign in to comment.