File: run_tests_for_cloudbuild.sh

package info (click to toggle)
golang-golang-x-tools 1%3A0.1.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,588 kB
  • sloc: javascript: 2,011; asm: 1,458; sh: 174; yacc: 155; makefile: 21; ansic: 17
file content (28 lines) | stat: -rwxr-xr-x 1,218 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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.

# Substitute the locally built gopls binary for use in govim integration tests.
go test -short ./cmd/govim -gopls /workspace/gopls/gopls

# Stash the error, for use in a later build step.
echo "exit $?" > /workspace/govim_test_result.sh

# 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