Skip to content

Commit

Permalink
Enable GitHub Actions for the e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Duan <[email protected]>
  • Loading branch information
waltforme committed Mar 5, 2024
1 parent 3737ea7 commit 774431c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: E2E test

on:
workflow_call:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'

jobs:
test-controlplane-lifecycle-management:
name: Test ControlPlane lifecycle management
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: ''

- uses: actions/setup-go@v5
with:
go-version: v1.19
cache: true

- name: Install kubectl
uses: azure/setup-kubectl@v3
id: install

- name: Run test
run: |
test/e2e/run.sh
- name: Show kubeconfig contexts
if: always()
run: kubectl config get-contexts

- name: Show running components of KubeFlex
if: always()
run: kubectl --context kind-kubeflex -n kubeflex-system get all

- name: Show logs of the KubeFlex controller manager
if: always()
run: kubectl --context kind-kubeflex -n kubeflex-system logs deploy/kubeflex-controller-manager

- name: Show logs of the shared Postgres DB
if: always()
run: kubectl --context kind-kubeflex -n kubeflex-system logs sts/postgres-postgresql

- name: Show logs of the KubeFlex operator
if: always()
run: kubectl --context kind-kubeflex -n kubeflex-system logs job/kubeflex-operator
4 changes: 2 additions & 2 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
End-to-end test that can be used manually by a contributor or be triggered by CI.
End-to-end tests that can be used manually by a contributor or be triggered by CI.

## Prerequisites
`kind` and `kubectl` are required to run the test.

## Use the test manually
## Use the tests manually
In the root directory of this git repo:
```
test/e2e/run.sh
Expand Down
1 change: 0 additions & 1 deletion test/e2e/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ set -x # echo so that users can understand what is happening
: -------------------------------------------------------------------------
: "Cleaning up from previous run of an e2e test"
:

kubectl config use-context kind-kubeflex
kubectl config delete-context cp1 &> /dev/null
kubectl config delete-context cp2 &> /dev/null
Expand Down

0 comments on commit 774431c

Please sign in to comment.