Skip to content

Commit

Permalink
Reduce PR check failures (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoodman authored Mar 2, 2022
1 parent 1e75cb0 commit 635904f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ name: "CodeQL Security Scan"

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
branches:
# only run when there are pushes to the main branch (not on PRs)
- main

schedule:
- cron: '0 0 * * 3'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Validations"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

env:
Expand Down
35 changes: 31 additions & 4 deletions test/install/test_harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ TEST_INSTALL_SH=true
. ../../install.sh
set -u

echoerr() {
echo "$@" 1>&2
}

printferr() {
printf "%s" "$*" >&2
}


assertTrue() {
if eval "$1"; then
echo "assertTrue failed: $2"
Expand Down Expand Up @@ -93,16 +102,34 @@ setup_snapshot_server() {
python3 -m http.server --directory "$(snapshot_dir)" $serve_port &> /dev/null &
worker_pid=$!

# it takes some time for the server to be ready...
sleep 3
echoerr "serving up $(snapshot_dir) on port $serve_port"

echoerr "$(ls -1 $(snapshot_dir) | sed 's/^/ ▕―― /')"

check_snapshots_server_ready

echoerr "snapshot server ready! (worker=${worker_pid})"

echo "$worker_pid"
}

check_snapshots_server_ready() {
i=0
until $(curl -m 3 --output /dev/null --silent --head --fail localhost:$serve_port/); do
sleep 1
((i=i+1))
if [ "$i" -gt "30" ]; then
echoerr "could not connect to local snapshot server! bailing..."
exit 1
fi
printferr '.'
done
}

teardown_snapshot_server() {
worker_pid="$1"

kill $worker_pid
echoerr "stopping worker=${worker_pid}"
kill "$worker_pid"
}

snapshot_version() {
Expand Down

0 comments on commit 635904f

Please sign in to comment.