Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/install-flux/install-flux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if [ -z "$FLUX_VERSION" ]; then
fi

for i in 1 2 3; do
echo "Attempt $i to install Flux version $FLUX_VERSION..."
flux install --namespace=flux-system --version=v"$FLUX_VERSION" --components=source-controller --network-policy=false && \
kubectl wait --for=condition=available deployment -l app.kubernetes.io/component=source-controller -n flux-system --timeout=120s && break
echo "Attempt $i failed, retrying in 10 seconds..."
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/install-gitea/install-gitea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ echo "$output"
output=$(kubectl exec -it "$gitea_pod" -n gitea -- gitea admin user generate-access-token --username "$GITEA_USERNAME" --token-name "$GITEA_ACCESS_TOKEN_NAME" --scopes "write:repository,write:user" --raw)
echo "$output"

echo "gitea-access-token=$output" >> "$GITHUB_OUTPUT"
if [ -n "$GITHUB_OUTPUT" ]; then
echo "gitea-access-token=$output" >> "$GITHUB_OUTPUT"
else
export GITEA_ACCESS_TOKEN="$output"
fi
34 changes: 34 additions & 0 deletions .github/workflows/long-running-test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# ------------------------------------------------------------
# Copyright 2023 The Radius Authors.
#
# 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
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------

name: Long-running test on Azure

permissions:
contents: read
packages: read

on:
# Enable manual trigger to deploy the latest changes from main.
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check Environment
run: make test-check-environment
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Exclude environment files
*.env
24 changes: 23 additions & 1 deletion build/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,26 @@ RAD_LOCATION := /usr/local/bin/rad
.PHONY: install
install: build-binaries ## Installs a local build for development
@echo "$(ARROW) Installing rad"
cp $(OUT_DIR)/$(GOOS)_$(GOARCH)/$(BUILDTYPE_DIR)/rad$(BINARY_EXT) $(RAD_LOCATION)
sudo cp $(OUT_DIR)/$(GOOS)_$(GOARCH)/$(BUILDTYPE_DIR)/rad$(BINARY_EXT) $(RAD_LOCATION)

.PHONY: install-latest
install-latest: ## Installs the latest release from GitHub
@echo "$(ARROW) Installing latest rad release"
@bash ./deploy/install.sh

FLUX_VERSION ?= 2.5.1
.PHONY: install-flux
install-flux: ## Installs flux using the install script
@echo "$(ARROW) Installing flux"
@export FLUX_VERSION=$(FLUX_VERSION) && curl -s https://fluxcd.io/install.sh | sudo -E bash
@./.github/actions/install-flux/install-flux.sh $(FLUX_VERSION)

GITEA_VERSION ?= v11.0.0
GITEA_USERNAME ?= "testuser"
GITEA_EMAIL ?= "testuser@radapp.io"
GITEA_ACCESS_TOKEN_NAME ?= "radius-functional-test"
GITEA_PASSWORD ?= ""
.PHONY: install-gitea
install-gitea: ## Installs gitea
@echo "$(ARROW) Installing gitea"
@export GITEA_PASSWORD=$(GITEA_PASSWORD) && .github/actions/install-gitea/install-gitea.sh $(GITEA_VERSION) $(GITEA_USERNAME) $(GITEA_EMAIL) $(GITEA_ACCESS_TOKEN_NAME)
18 changes: 15 additions & 3 deletions build/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ test-ucp-spec-examples: oav-installed ## Validates UCP examples conform to UCP O
# @echo "$(ARROW) Testing x-ms-examples conform to ucp spec..."
# oav validate-example swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json

.PHONY: test-deploy-lrt-cluster
test-deploy-aks-cluster: ## Deploys an AKS cluster to Azure for the long-running tests. Optional parameters: [TEST_AKS_AZURE_LOCATION=<location>] [TEST_AKS_RG=<resource group name>]
@bash ./build/test.sh
.PHONY: test-deploy-aks-cluster
test-deploy-aks-cluster: ## Deploys an AKS cluster to Azure for the long-running tests. Optional parameters: [LRT_AZURE_LOCATION=<location>] [LRT_RG=<resource group name>]
@bash ./build/test.sh deploy-aks-cluster

.PHONY: test-lrt
test-lrt: ## Runs the long-running tests against the AKS cluster deployed by test-deploy-lrt-cluster using the currently installed version of the Radius CLI and the current az authenticated subscription.
@bash ./build/test.sh run-lrt

.PHONY: test-create-env-file
test-create-env-file: ## Creates a test.env file with environment variables for testing
./build/test.sh create-env-file

.PHONY: test-check-environment
test-check-environment: ## Checks the environment for required tools and configurations for testing
@bash ./build/test.sh check-environment
Loading
Loading