Skip to content

End to End Test

End to End Test #938

Workflow file for this run

name: End to End Test
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
schedule:
- cron: "34 10,13 * * *"
pull_request:
branches:
- main
env:
PYPI_RELEASE_VERSION: 100.0.0
RELEASE_VERSION: 0.0.0-dev
NEXUS_IMAGE: sonatype/nexus3:3.40.1
NEXUS_USER_NAME: admin
NEXUS_USER_PWD: admin123
PORT_NEXUS: 8081
PORT_CONTROLLER: 8082
PORT_NEXUS_DOCKER: 8083
IP_DOCKER_BRIDGE: 172.17.0.1
REPO_NAME_DOCKER: docker-hosted
REPO_NAME_PYPI: pypi-hosted
jobs:
filter:
runs-on: ubuntu-latest
outputs:
client: ${{ steps.filter.outputs.client }}
server: ${{ steps.filter.outputs.server }}
scripts: ${{ steps.filter.outputs.scripts }}
docker: ${{ steps.filter.outputs.docker }}
example: ${{ steps.filter.outputs.example }}
labels: ${{ steps.pr-labels.outputs.labels }}
steps:
- uses: actions/checkout@v3
- name: Get PR labels
id: pr-labels
uses: joerick/pr-labels-action@v1.0.6
- name: Check for files changed
uses: getsentry/paths-filter@v2
id: filter
with:
base: main
filters: .github/file-filter.yml
e2e-test:
runs-on: ubuntu-latest
needs:
- filter
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || (github.event_name == 'pull_request' && (needs.filter.outputs.client == 'true' || needs.filter.outputs.server == 'true' || needs.filter.outputs.scripts == 'true' || needs.filter.outputs.docker == 'true' || needs.filter.outputs.example == 'true') && contains(needs.filter.outputs.labels, 'e2e'))}}
defaults:
run:
shell: bash
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}
architecture: "x64"
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
cache: "maven"
server-id: starwhale # Value of the distributionManagement/repository/id field of the pom.xml
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Startup nexus service
working-directory: ./scripts/e2e_test
run: bash start_test.sh start_nexus &
- name: Startup minikube
uses: medyagh/setup-minikube@latest
id: minikube
with:
cache: true
driver: docker
container-runtime: docker
memory: 6G
cpus: 2
wait: false
insecure-registry: "192.0.0.0/8,10.0.0.0/8"
- name: Overwrite configs
working-directory: ./scripts/e2e_test
run: |
bash start_test.sh overwrite_pip_config
bash start_test.sh overwrite_pypirc
- name: Build Console(mock index.html)
working-directory: ./scripts/e2e_test
run: bash start_test.sh build_console
- name: Build server docker image
working-directory: ./scripts/e2e_test
run: |
eval $(minikube docker-env)
bash start_test.sh build_server_image
- name: Startup starwhale k8s service
working-directory: ./scripts/e2e_test
run: bash start_test.sh start_starwhale
- name: Build client python package
working-directory: ./scripts/e2e_test
run: bash start_test.sh build_swcli
env:
SKIP_UI_BUILD: 1
- name: Check nexus service available
working-directory: ./scripts/e2e_test
run: |
bash start_test.sh create_service_check_file
bash start_test.sh check_nexus_service
- name: Prepare nexus repositories
working-directory: ./scripts/e2e_test
run: bash start_test.sh create_repository_in_nexus
- name: Upload pypi into nexus
working-directory: ./scripts/e2e_test
run: bash start_test.sh upload_pypi_to_nexus
- name: Build runtime image
working-directory: ./scripts/e2e_test
run: |
eval $(minikube docker-env)
bash start_test.sh build_runtime_image
- name: Wait and check starwhale service
working-directory: ./scripts/e2e_test
run: bash start_test.sh check_controller_service
- name: Test by client side
working-directory: ./scripts/e2e_test
run: bash start_test.sh client_test
env:
SKIP_UI_BUILD: 1
- name: Post output client-side test logs
if: failure()
working-directory: ./scripts/e2e_test
run: |
minikube image ls --format table
bash start_test.sh show_minikube_jobs_log
- name: Test by api side
working-directory: ./scripts/e2e_test
run: bash start_test.sh api_test