dev/ci: remove set -x in all tests (#36577)

IMO the utility of these are quite debatable, and they make CI output quite difficult to read. Things we can do instead:

- Just add set -x when you're debugging something
- Add better messages with echo
- Move things to sg where we might be able to add a -debug mode one day
This commit is contained in:
Robert Lin 2022-06-03 13:52:48 -07:00 committed by GitHub
parent e4f07d6151
commit 4ed1766055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 14 deletions

View File

@ -56,7 +56,6 @@ function go_test() {
# Create annotation from test failure
if [ "$test_exit_code" -ne 0 ]; then
set -x
echo "~~~ Creating test failures anotation"
RICHGO_CONFIG="./.richstyle.yml"
cp "$REPO_ROOT/dev/ci/go-test-failures.richstyle.yml" $RICHGO_CONFIG

View File

@ -3,7 +3,7 @@
# This script runs the backend integration tests against a running server.
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
set -ex
set -e
URL="${1:-"http://localhost:7080"}"

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euxo pipefail
set -euo pipefail
# setup DIR for easier pathing test dir
test_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)""
@ -85,7 +85,7 @@ function test_setup() {
set +x +u
# shellcheck disable=SC1091
source /root/.sg_envrc
set -x -u
set -u
echo "--- TEST: Checking Sourcegraph instance is accessible"

View File

@ -5,7 +5,7 @@
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
root_dir=$(pwd)
set -ex
set -e
export SOURCEGRAPH_BASE_URL="${1:-"http://localhost:7080"}"
@ -21,7 +21,6 @@ pushd dev/ci/integration/code-intel || exit 1
set +x
# shellcheck disable=SC1091
source /root/.sg_envrc
set -x
"${root_dir}/init-sg" addRepos -config repos.json
popd || exit 1

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
set -ex
set -e
URL="${1:-"http://localhost:7080"}"

View File

@ -6,7 +6,7 @@ export SOURCEGRAPH_BASE_URL="${1:-"http://localhost:7080"}"
source /root/.profile
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
set -ex
set -e
echo "--- init sourcegraph"
pushd internal/cmd/init-sg
@ -17,7 +17,6 @@ popd
set +x
# shellcheck disable=SC1091
source /root/.sg_envrc
set -x
echo "--- TEST: Checking Sourcegraph instance is accessible"
curl -f http://localhost:7080

View File

@ -4,7 +4,7 @@
source /root/.profile
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
root_dir=$(pwd)
set -ex
set -e
URL="${1:-"http://localhost:7080"}"
@ -31,11 +31,8 @@ pushd internal/cmd/init-sg
go build
./init-sg initSG
popd
# Load variables set up by init-server, disabling `-x` to avoid printing variables
set +x
# shellcheck disable=SC1091
source /root/.sg_envrc
set -x
# Stop old Sourcegraph release
docker container stop "$CONTAINER"

View File

@ -2,6 +2,6 @@
cd "$(dirname "${BASH_SOURCE[0]}")"/../..
set -ex
set -e
psql -d sourcegraph-test-db -c 'drop schema public cascade; create schema public;'