2020-01-13 13:22:19 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright 2020 The Go Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
# This script runs govim integration tests but always succeeds, instead writing
|
|
|
|
# their result to a file so that any test failure can be deferred to a later
|
|
|
|
# build step. We do this so that we can capture govim test artifacts regardless
|
|
|
|
# of the test results.
|
|
|
|
|
2020-03-26 15:58:25 -06:00
|
|
|
# See golang.org/issues/38042. Temporarily disable telemetry until event
|
|
|
|
# exporters are threadsafe.
|
|
|
|
export GOVIM_GOPLS_FLAGS="-telemetry.disable"
|
|
|
|
|
2020-01-13 13:22:19 -07:00
|
|
|
# Substitute the locally built gopls binary for use in govim integration tests.
|
2020-03-26 15:58:25 -06:00
|
|
|
go test -short ./cmd/govim -gopls /workspace/gopls/gopls
|
2020-01-13 13:22:19 -07:00
|
|
|
|
|
|
|
# Stash the error, for use in a later build step.
|
|
|
|
echo "exit $?" > /workspace/govim_test_result.sh
|
2020-02-04 18:14:12 -07:00
|
|
|
|
|
|
|
# Clean up unnecessary artifacts. This is based on govim/_scripts/tidyUp.bash.
|
|
|
|
# Since we're fetching govim using the go command, we won't have this non-go
|
|
|
|
# source directory available to us.
|
|
|
|
if [[ -n "$GOVIM_TESTSCRIPT_WORKDIR_ROOT" ]]; then
|
|
|
|
echo "Cleaning up build artifacts..."
|
|
|
|
# Make artifacts writable so that rm -rf doesn't complain.
|
|
|
|
chmod -R u+w "$GOVIM_TESTSCRIPT_WORKDIR_ROOT"
|
|
|
|
|
|
|
|
# Remove directories we don't care about.
|
|
|
|
find "$GOVIM_TESTSCRIPT_WORKDIR_ROOT" -type d \( -name .vim -o -name gopath \) -prune -exec rm -rf '{}' \;
|
|
|
|
fi
|