-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting functional tests as cloud and non-cloud
Signed-off-by: ytimocin <[email protected]>
- Loading branch information
Showing
5 changed files
with
777 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
|
@@ -14,11 +14,11 @@ | |
# limitations under the License. | ||
# ------------------------------------------------------------ | ||
|
||
name: Functional tests | ||
name: Functional tests - Cloud | ||
|
||
permissions: | ||
id-token: write # Required for requesting the JWT | ||
contents: read # Required for listing the commits | ||
contents: read # Required for listing the commits | ||
packages: write # Required for uploading the package | ||
|
||
on: | ||
|
@@ -33,31 +33,31 @@ on: | |
repository_dispatch: | ||
types: [de-functional-test] | ||
workflow_run: | ||
workflows: ['Approve Functional Tests'] | ||
workflows: ["Approve Functional Tests"] | ||
types: | ||
- completed | ||
|
||
env: | ||
# Go version | ||
GOVER: '1.22.2' | ||
GOVER: "1.22.2" | ||
GOPROXY: https://proxy.golang.org | ||
|
||
# gotestsum version - see: https://github.com/gotestyourself/gotestsum | ||
GOTESTSUM_VER: 1.10.0 | ||
|
||
# Helm version | ||
HELM_VER: 'v3.12.0' | ||
HELM_VER: "v3.12.0" | ||
# KinD cluster version | ||
KIND_VER: 'v0.20.0' | ||
KIND_VER: "v0.20.0" | ||
# Dapr version | ||
DAPR_VER: '1.12.0' | ||
DAPR_DASHBOARD_VER: '0.14.0' | ||
DAPR_VER: "1.12.0" | ||
DAPR_DASHBOARD_VER: "0.14.0" | ||
# Kubectl version | ||
KUBECTL_VER: 'v1.25.0' | ||
KUBECTL_VER: "v1.25.0" | ||
# Azure Keyvault CSI driver chart version | ||
AZURE_KEYVAULT_CSI_DRIVER_VER: '1.4.2' | ||
AZURE_KEYVAULT_CSI_DRIVER_VER: "1.4.2" | ||
# Azure workload identity webhook chart version | ||
AZURE_WORKLOAD_IDENTITY_WEBHOOK_VER: '1.1.0' | ||
AZURE_WORKLOAD_IDENTITY_WEBHOOK_VER: "1.1.0" | ||
# Container registry for storing container images | ||
CONTAINER_REGISTRY: ghcr.io/radius-project/dev | ||
# Container registry for storing Bicep recipe artifacts | ||
|
@@ -71,11 +71,11 @@ env: | |
# The Radius helm chart location. | ||
RADIUS_CHART_LOCATION: deploy/Chart/ | ||
# The region for AWS resources | ||
AWS_REGION: 'us-west-2' | ||
AWS_REGION: "us-west-2" | ||
# The AWS account ID | ||
AWS_ACCOUNT_ID: '${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }}' | ||
AWS_ACCOUNT_ID: "${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }}" | ||
# The current GitHub action link | ||
ACTION_LINK: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||
ACTION_LINK: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
# Server where terraform test modules are deployed | ||
TF_RECIPE_MODULE_SERVER_URL: "http://tf-module-server.radius-test-tf-module-server.svc.cluster.local" | ||
# The functional test GitHub app id | ||
|
@@ -91,8 +91,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: github.event_name == 'repository_dispatch' || (github.event_name == 'schedule' && github.repository == 'radius-project/radius') || github.event_name == 'workflow_run' | ||
env: | ||
DE_IMAGE: 'ghcr.io/radius-project/deployment-engine' | ||
DE_TAG: 'latest' | ||
DE_IMAGE: "ghcr.io/radius-project/deployment-engine" | ||
DE_TAG: "latest" | ||
outputs: | ||
REL_VERSION: ${{ steps.gen-id.outputs.REL_VERSION }} | ||
UNIQUE_ID: ${{ steps.gen-id.outputs.UNIQUE_ID }} | ||
|
@@ -106,7 +106,7 @@ jobs: | |
- name: Get GitHub app token | ||
uses: tibdex/github-app-token@v2 | ||
id: get_installation_token | ||
with: | ||
with: | ||
app_id: ${{ env.FUNCTIONAL_TEST_APP_ID }} | ||
private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }} | ||
- name: Set up checkout target (scheduled) | ||
|
@@ -117,16 +117,16 @@ jobs: | |
- name: Set up checkout target (pull_request) | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV | ||
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV | ||
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
- name: Use custom actions | ||
uses: actions/checkout@v4 | ||
- name: 'Download PR data artifacts' | ||
- name: "Download PR data artifacts" | ||
if: github.event_name == 'workflow_run' | ||
uses: ./.github/actions/download-pr-data-artifact | ||
id: get-pr-number | ||
- name: 'Set PR context (workflow_run)' | ||
- name: "Set PR context (workflow_run)" | ||
if: github.event_name == 'workflow_run' | ||
uses: actions/github-script@v7 | ||
with: | ||
|
@@ -175,7 +175,7 @@ jobs: | |
fi | ||
UNIQUE_ID=func$(echo $BASE_STR | sha1sum | head -c 10) | ||
echo "REL_VERSION=pr-${UNIQUE_ID}" >> $GITHUB_ENV | ||
# Set output variables to be used in the other jobs | ||
echo "REL_VERSION=pr-${UNIQUE_ID}" >> $GITHUB_OUTPUT | ||
echo "UNIQUE_ID=${UNIQUE_ID}" >> $GITHUB_OUTPUT | ||
|
@@ -194,7 +194,7 @@ jobs: | |
header: teststatus-${{ github.run_id }} | ||
number: ${{ env.PR_NUMBER }} | ||
hide: true | ||
hide_classify: 'OUTDATED' | ||
hide_classify: "OUTDATED" | ||
message: | | ||
## Radius functional test overview | ||
|
@@ -223,7 +223,7 @@ jobs: | |
* deployment-engine test image location: `${{ env.DE_IMAGE }}:${{ env.DE_TAG }}` | ||
</details> | ||
## Test Status | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
|
@@ -324,11 +324,11 @@ jobs: | |
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
name: [ucp,kubernetes,shared,msgrp,daprrp,samples,cli] | ||
name: [corerp-cloud, ucp-cloud] | ||
include: | ||
# datastorerp functional tests need the larger VM. | ||
- os: ubuntu-latest-m | ||
name: datastoresrp | ||
name: datastoresrp-cloud | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} | ||
|
@@ -345,14 +345,14 @@ jobs: | |
- name: Get GitHub app token | ||
uses: tibdex/github-app-token@v2 | ||
id: get_installation_token | ||
with: | ||
with: | ||
app_id: ${{ env.FUNCTIONAL_TEST_APP_ID }} | ||
private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }} | ||
- uses: LouisBrunner/[email protected] | ||
if: always() | ||
with: | ||
token: ${{ steps.get_installation_token.outputs.token }} | ||
name: 'Functional Test Run' | ||
name: "Functional Test Run" | ||
status: in_progress | ||
repo: ${{ github.repository }} | ||
sha: ${{ env.CHECKOUT_REF }} | ||
|
@@ -577,15 +577,15 @@ jobs: | |
BICEP_RECIPE_REGISTRY: ${{ env.BICEP_RECIPE_REGISTRY }} | ||
BICEP_RECIPE_TAG_VERSION: ${{ env.BICEP_RECIPE_TAG_VERSION }} | ||
GH_TOKEN: ${{ steps.get_installation_token.outputs.token }} | ||
GOTESTSUM_OPTS: '--junitfile ./dist/functional_test/results.xml' | ||
GOTESTSUM_OPTS: "--junitfile ./dist/functional_test/results.xml" | ||
- name: Process Functional Test Results | ||
uses: ./.github/actions/process-test-results | ||
# In case of failure, upload functional_test_results to artifacts so that they are not erased by subsequent runs. | ||
if: failure() && github.repository == 'radius-project/radius' | ||
with: | ||
test_group_name: 'Functional Tests - ${{ matrix.name }}' | ||
artifact_name: 'functional_test_results_${{ matrix.name }}' | ||
result_directory: 'dist/functional_test/' | ||
test_group_name: "Functional Tests - ${{ matrix.name }}" | ||
artifact_name: "functional_test_results_${{ matrix.name }}" | ||
result_directory: "dist/functional_test/" | ||
- uses: azure/setup-kubectl@v4 | ||
if: always() | ||
with: | ||
|
@@ -620,7 +620,7 @@ jobs: | |
echo "Pod logs saved to recipes/pod-logs/" | ||
# Get kubernetes events and save to file | ||
kubectl get events -n $namespace > recipes/pod-logs/events.txt | ||
- name: Upload Terraform recipe publishing logs | ||
- name: Upload Terraform recipe publishing logs | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
|
@@ -676,7 +676,7 @@ jobs: | |
- name: Get GitHub app token | ||
uses: tibdex/github-app-token@v2 | ||
id: get_installation_token | ||
with: | ||
with: | ||
app_id: ${{ env.FUNCTIONAL_TEST_APP_ID }} | ||
private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }} | ||
- name: Get tests job status | ||
|
@@ -703,7 +703,7 @@ jobs: | |
if: always() | ||
with: | ||
token: ${{ steps.get_installation_token.outputs.token }} | ||
name: 'Functional Test Run' | ||
name: "Functional Test Run" | ||
repo: ${{ github.repository }} | ||
sha: ${{ env.CHECKOUT_REF }} | ||
status: completed | ||
|
@@ -729,7 +729,7 @@ jobs: | |
event: 'schedule', | ||
per_page: 10 | ||
}); | ||
failureCount = 1; | ||
for (const run of response.data.workflow_runs) { | ||
if (run.conclusion === 'failure') { | ||
|
@@ -751,4 +751,4 @@ jobs: | |
title: `Scheduled functional test failed - Run ID: ${context.runId}`, | ||
labels: ['bug', 'test-failure'], | ||
body: `## Bug information \n\nThis bug is generated automatically if the scheduled functional test fails at least ${process.env.ISSUE_CREATE_THRESHOLD} times in a row. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` | ||
}) | ||
}) |
Oops, something went wrong.