Skip to content

Commit

Permalink
add etcd test analyzer build and integrate into measure-test-flakines…
Browse files Browse the repository at this point in the history
…s workflow

Signed-off-by: Chao Chen <[email protected]>
  • Loading branch information
chaochn47 committed Mar 20, 2023
1 parent 30abf17 commit 7b1069a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/measure-test-flakiness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Measure Test Flakiness

on:
schedule:
- cron: "0 0 * * 0"
- cron: "0 0 * * 0" # run every Sunday at midnight

permissions: read-all

Expand All @@ -12,6 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- run: "./scripts/measure-test-flakiness.sh"
env:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/measure-test-flakiness.sh
GOARCH=amd64 ./scripts/build_etcd_test_analyzer.sh
bin/etcd-test-analyzer run -token $GITHUB_TOKEN -max-age=168h -workflow Tests -branch main
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ build:
tools:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v" ./scripts/build_tools.sh

.PHONY: test-analyzer
test-analyzer:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v" ./scripts/build_etcd_test_analyzer.sh

# Tests

GO_TEST_FLAGS?=
Expand Down
6 changes: 6 additions & 0 deletions scripts/build_etcd_test_analyzer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

source ./scripts/test_lib.sh
source ./scripts/build_lib.sh

run_build etcd_test_analyzer_build
18 changes: 18 additions & 0 deletions scripts/build_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ tools_build() {
done
}

etcd_test_analyzer_build() {
out="bin"
tool="etcd-test-analyzer"
dst="${PWD}/${out}/${tool}"
if [[ -n "${BINDIR}" ]]; then out="${BINDIR}"; fi
pushd /tmp || return 1
if [[ ! -d "$tool" ]]; then
git clone "https://github.com/endocrimes/$tool.git"
fi
cd "$tool" || return 1
echo "Building" "'${tool}'" "to" "'${dst}'"...
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} \
-trimpath \
-installsuffix=cgo \
-o="${dst}" || return 2
popd || return 1
}

run_build() {
echo Running "$1"
if $1; then
Expand Down

0 comments on commit 7b1069a

Please sign in to comment.