github workflow: drop measure test flakiness

Signed-off-by: zgzhang4 <zgzhang4@iflytek.com>
This commit is contained in:
zgzhang4 2024-04-29 10:53:43 +08:00 committed by Alex Zhang
parent b36d9b2156
commit 0bd0c4a21b
4 changed files with 1 additions and 88 deletions

View File

@ -1,23 +0,0 @@
---
name: Measure Test Flakiness
on:
schedule:
- cron: "0 0 * * 0" # run every Sunday at midnight
permissions: read-all
jobs:
measure-test-flakiness:
name: Measure Test Flakiness
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
./scripts/measure-test-flakiness.sh
make bin/etcd-test-analyzer
bin/etcd-test-analyzer run -token $GITHUB_TOKEN -max-age=168h -workflow Tests -branch main

View File

@ -3,7 +3,7 @@ name: Measure TestGrid Flakiness
on:
schedule:
- cron: "0 0 * * 0" # run every Sunday at midnight
- cron: "0 0 * * *" # run every day at midnight
permissions: read-all

View File

@ -10,17 +10,6 @@ build:
tools:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build_tools.sh
TEMP_TEST_ANALYZER_DIR=/tmp/etcd-test-analyzer
TEST_ANALYZER_BIN=${PWD}/bin
bin/etcd-test-analyzer: $(TEMP_TEST_ANALYZER_DIR)/*
make -C ${TEMP_TEST_ANALYZER_DIR} build
mkdir -p ${TEST_ANALYZER_BIN}
install ${TEMP_TEST_ANALYZER_DIR}/bin/etcd-test-analyzer ${TEST_ANALYZER_BIN}
${TEST_ANALYZER_BIN}/etcd-test-analyzer -h
$(TEMP_TEST_ANALYZER_DIR)/*:
git clone "https://github.com/endocrimes/etcd-test-analyzer.git" ${TEMP_TEST_ANALYZER_DIR}
# Tests
GO_TEST_FLAGS?=

View File

@ -1,53 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -z ${GITHUB_TOKEN:-} ]]
then
echo "Please set the \$GITHUB_TOKEN environment variable for the script to work"
exit 1
fi
temp_dir=$(mktemp -d)
trap '{ rm -rf -- "${temp_dir}"; }' EXIT
json_file="${temp_dir}/commit-and-check-data.json"
# This GraphQL query retrieves information about the most recent commits to the default branch of the "etcd" repository owned by "etcd-io".
# Specifically, it retrieves the commit URL and the state of the status check rollup for each of the 100 most recent commits on the default branch.
# {
# repository(owner: "etcd-io", name: "etcd") {
# defaultBranchRef {
# target {
# ... on Commit {
# history(first: 100) {
# edges {
# node {
# ... on Commit {
# commitUrl
# statusCheckRollup {
# state
# }
# }
# }
# }
# }
# }
# }
# }
# }
# }
# Try this above query in https://docs.github.com/en/graphql/overview/explorer
curl --fail --show-error --silent -H "Authorization: token ${GITHUB_TOKEN}" \
-X POST \
-d '{
"query": "query { repository(owner: \"etcd-io\", name: \"etcd\") { defaultBranchRef { target { ... on Commit { history(first: 100) { edges { node { ... on Commit { commitUrl statusCheckRollup { state } } } } } } } } } }"
}' \
https://api.github.com/graphql | jq . > "${json_file}"
failure_percentage=$(jq '.data.repository.defaultBranchRef.target.history.edges | reduce .[] as $item (0; if $item.node.statusCheckRollup.state == "FAILURE" then (. + 1) else . end)' "${json_file}")
echo "Commit status failure percentage is - ${failure_percentage} %"