forked from pingcap/tidb-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add upload e2e snapshots workflow (pingcap#1154)
* test: add upload e2e snapshots workflow * test: update cypress env * fix: actions/checkout ref
- Loading branch information
Showing
1 changed file
with
111 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0. | ||
name: Upload E2E Snapshots | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: "The branch, tag or SHA to create snapshots" | ||
required: true | ||
|
||
jobs: | ||
e2e_test_snapshots: | ||
name: Take E2E Test Snapshots | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
# test latest features and compatibility of lower version | ||
include: | ||
- feature_version: 6.0.0 | ||
tidb_version: nightly | ||
- feature_version: 5.0.0 | ||
tidb_version: v5.0.0 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: "1.13.5" | ||
- name: Lookup yarn cache | ||
id: yarn_cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.yarn_cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-e2e-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn-e2e | ||
- name: Load go module cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Load TiUP cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.tiup/components | ||
key: ${{ runner.os }}-tiup | ||
restore-keys: | | ||
${{ runner.os }}-tiup | ||
- name: Install and run TiUP in the background | ||
run: | | ||
chmod u+x scripts/start_tiup.sh | ||
scripts/start_tiup.sh ${{ matrix.tidb_version }} | ||
- name: Build UI | ||
run: | | ||
make ui | ||
env: | ||
NO_MINIMIZE: true | ||
CI: true | ||
REACT_APP_MIXPANEL_TOKEN: "" | ||
- name: Wait TiUP Playground | ||
run: | | ||
chmod u+x scripts/wait_tiup_playground.sh | ||
scripts/wait_tiup_playground.sh 15 20 | ||
- name: Debug TiUP | ||
run: | | ||
source /home/runner/.profile | ||
tiup --version | ||
ls /home/runner/.tiup/components/playground/ | ||
DATA_PATH=$(ls /home/runner/.tiup/data/) | ||
echo $DATA_PATH | ||
echo "==== TiDB Log ====" | ||
head -n 3 /home/runner/.tiup/data/$DATA_PATH/tidb-0/tidb.log | ||
echo "==== TiKV Log ====" | ||
head -n 3 /home/runner/.tiup/data/$DATA_PATH/tikv-0/tikv.log | ||
echo "==== PD Log ====" | ||
head -n 3 /home/runner/.tiup/data/$DATA_PATH/pd-0/pd.log | ||
- name: Build and run backend in the background | ||
run: | | ||
make | ||
make run & | ||
env: | ||
UI: 1 | ||
FEATURE_VERSION: ${{ matrix.feature_version }} | ||
- name: Run E2E Features Test | ||
run: make e2e_test | ||
env: | ||
SERVER_URL: http://127.0.0.1:12333/dashboard/ | ||
CI: true | ||
FEATURE_VERSION: ${{ matrix.feature_version }} | ||
TIDB_VERSION: ${{ matrix.tidb_version }} | ||
CYPRESS_ALLOW_SCREENSHOT: true | ||
- name: Archive Test Results | ||
if: always() | ||
run: | | ||
cat ui/start_tiup.log | ||
echo "===============" | ||
cat ui/wait_tiup.log | ||
- name: Upload snapshots artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: e2e-snapshots-${{ matrix.feature_version }} | ||
path: ${{ github.workspace }}/ui/cypress/screenshots/**/* |