forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathunit_test_evalengine_mysql57.yml
More file actions
155 lines (129 loc) · 5.24 KB
/
unit_test_evalengine_mysql57.yml
File metadata and controls
155 lines (129 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
name: Unit Test (evalengine_mysql57)
on:
push:
branches:
- "main"
- "release-[0-9]+.[0-9]"
branches-ignore:
- 'slack-[0-9]+.[0-9]'
tags: '**'
pull_request:
branches: '**'
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (evalengine_mysql57)')
cancel-in-progress: true
permissions: read-all
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
GOPRIVATE: "github.com/slackhq/vitess-addons"
jobs:
test:
name: Unit Test (evalengine_mysql57)
runs-on: vitess-ubuntu24-16cpu-1
steps:
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- name: Check for changes in relevant files
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
id: changes
with:
token: ''
filters: |
unit_tests:
- 'test/config.json'
- 'go/**'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/unit_test_evalengine_mysql57.yml'
- name: Set up Go
if: steps.changes.outputs.unit_tests == 'true'
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
- name: Setup GitHub access token
if: steps.changes.outputs.unit_tests == 'true'
run: git config --global url.https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/.insteadOf https://github.com/
- name: Set up python
if: steps.changes.outputs.unit_tests == 'true'
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
- name: Tune the OS
if: steps.changes.outputs.unit_tests == 'true'
uses: ./.github/actions/tune-os
- name: Setup MySQL
if: steps.changes.outputs.unit_tests == 'true'
uses: ./.github/actions/setup-mysql
with:
flavor: mysql-5.7
- name: Get dependencies
if: steps.changes.outputs.unit_tests == 'true'
run: |
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk
mkdir -p dist bin
curl --max-time 10 --retry 3 --retry-max-time 45 -s -L https://github.com/coreos/etcd/releases/download/v3.5.25/etcd-v3.5.25-linux-amd64.tar.gz | tar -zxC dist
mv dist/etcd-v3.5.25-linux-amd64/{etcd,etcdctl} bin/
go mod download
go install golang.org/x/tools/cmd/goimports@latest
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
- name: Run make tools
if: steps.changes.outputs.unit_tests == 'true'
run: |
make tools
- name: Setup launchable dependencies
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
# verify that launchable setup is all correct.
launchable verify || true
# Tell Launchable about the build you are producing and testing
launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run test
if: steps.changes.outputs.unit_tests == 'true'
timeout-minutes: 30
run: |
set -exo pipefail
# We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
# which musn't be more than 107 characters long.
export VTDATAROOT="/tmp/"
export NOVTADMINBUILD=1
export VTEVALENGINETEST="1"
# We sometimes need to alter the behavior based on the platform we're
# testing, e.g. MySQL 5.7 vs 8.0.
export CI_DB_PLATFORM="mysql57"
make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- name: Record test results in launchable if PR is not a draft
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main' && !cancelled()
run: |
# send recorded tests to launchable
launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
- name: Print test output
if: steps.changes.outputs.unit_tests == 'true' && !cancelled()
run: |
# print test output
cat output.txt
- name: Test Summary
if: steps.changes.outputs.unit_tests == 'true' && !cancelled()
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "report.xml"
show: "fail"