Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add upload e2e snapshots workflow #1154

Merged
merged 4 commits into from
Jan 26, 2022
Merged
Changes from 2 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
110 changes: 110 additions & 0 deletions .github/workflows/upload-e2e-snapshots.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 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
Comment on lines +20 to +23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you expecting that the E2E artifacts are different in different version matrixes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. But there's different test cases in different version matrixes. May have different use for snapshot.

steps:
- name: Checkout code
uses: actions/checkout@v2
with: ${{ 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/**/*