-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-36460] Pull out a shared workflow definition shared by multipl…
…e test matrices
- Loading branch information
Showing
2 changed files
with
162 additions
and
160 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
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: E2E test workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
java-version: | ||
required: true | ||
type: string | ||
flink-version: | ||
required: true | ||
type: string | ||
http-client: | ||
required: false | ||
type: string | ||
default: "okhttp" | ||
namespace: | ||
required: false | ||
type: string | ||
default: "default" | ||
mode: | ||
required: false | ||
type: string | ||
default: "native" | ||
test: | ||
required: true | ||
type: string | ||
create-namespace: | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
e2e_test: | ||
name: ${{ inputs.test }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ inputs.java-version }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Start minikube | ||
run: | | ||
source e2e-tests/utils.sh | ||
start_minikube | ||
- name: Install cert-manager | ||
run: | | ||
kubectl get pods -A | ||
kubectl apply -f e2e-tests/cert-manager.yaml | ||
kubectl -n cert-manager wait --all=true --for=condition=Available --timeout=300s deploy | ||
- name: Build image | ||
run: | | ||
export SHELL=/bin/bash | ||
export DOCKER_BUILDKIT=1 | ||
eval $(minikube -p minikube docker-env) | ||
JAVA_VERSION=${{ inputs.java-version }} | ||
HTTP_CLIENT=${{ inputs.http-client }} | ||
docker build --progress=plain --no-cache -f ./Dockerfile -t flink-kubernetes-operator:ci-latest --progress plain --build-arg JAVA_VERSION="${JAVA_VERSION:-11}" --build-arg HTTP_CLIENT="${HTTP_CLIENT:-okhttp}" . | ||
docker images | ||
- name: Create ${{ inputs.namespace }} == ${{ inputs.create-namespace }} | ||
id: namespace-creator | ||
if: ${{ inputs.create-namespace }} | ||
run: | | ||
source e2e-tests/utils.sh | ||
create_namespace ${{ inputs.namespace }} | ||
echo EXTRA_HELM_INSTALL_ARGS="--set "watchNamespaces={default,flink}"" >> $GITHUB_OUTPUT | ||
- name: Start the operator | ||
run: | | ||
helm --debug install flink-kubernetes-operator -n ${{ inputs.namespace }} helm/flink-kubernetes-operator --set image.repository=flink-kubernetes-operator --set image.tag=ci-latest ${{ steps.namespace-creator.outputs.EXTRA_HELM_INSTALL_ARGS }} | ||
kubectl wait --for=condition=Available --timeout=120s -n ${{ inputs.namespace }} deploy/flink-kubernetes-operator | ||
kubectl get pods -n ${{ inputs.namespace }} | ||
- name: Run Flink e2e tests | ||
run: | | ||
FLINK_IMAGE=$(sed --regexp-extended 's/v([0-9]+)_([0-9]+)/flink:\1.\2/g' <<< ${{ inputs.flink-version }} ) | ||
echo FLINK_IMAGE=${FLINK_IMAGE} | ||
sed -i "s/image: flink:.*/image: ${FLINK_IMAGE}/" e2e-tests/data/*.yaml | ||
sed -i "s/flinkVersion: .*/flinkVersion: ${{ inputs.flink-version }}/" e2e-tests/data/*.yaml | ||
sed -i "s/mode: .*/mode: ${{ inputs.mode }}/" e2e-tests/data/*.yaml | ||
git diff HEAD | ||
echo "Running e2e-tests/$test" | ||
bash e2e-tests/${{ inputs.test }} || exit 1 | ||
git reset --hard | ||
- name: Stop the operator | ||
run: | | ||
helm uninstall -n ${{ inputs.namespace }} flink-kubernetes-operator | ||
- name: Stop minikube | ||
run: | | ||
source e2e-tests/utils.sh | ||
stop_minikube | ||