TeamCity: speed up ppc64le CI (#3622)

The builder is currently spending 15 to 20 minutes installing gcc and
upgrading packages every time we run the tests.
Because of this the build fails sometimes by running out of time.
This change reduces that to 5 minutes by:

* switching from curl to wget (which seems to have fewer dependencies)
* not installing gcc on ppc64le
* skipping tests that depend on gcc or other binutils
This commit is contained in:
Alessandro Arzilli 2024-01-09 23:13:00 +01:00 committed by GitHub
parent ae715a2b2d
commit 1a1e215fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 7 deletions

@ -2,12 +2,16 @@
set -e
set -x
apt-get -qq update
apt-get install -y gcc curl jq lsof
version=$1
arch=$2
apt-get -qq update
if [ "$arch" = "ppc64le" ]; then
apt-get install --no-upgrade -y wget jq
else
apt-get install --no-upgrade -y gcc wget jq lsof
fi
if [ "$arch" != "ppc64le" ]; then
apt-get install -y dwz
@ -17,7 +21,7 @@ fi
function getgo {
export GOROOT=/usr/local/go/$1
if [ ! -d "$GOROOT" ]; then
curl -sO https://dl.google.com/go/"$1".linux-"${arch}".tar.gz
wget -q https://dl.google.com/go/"$1".linux-"${arch}".tar.gz
mkdir -p /usr/local/go
tar -C /usr/local/go -xzf "$1".linux-"${arch}".tar.gz
mv -f /usr/local/go/go "$GOROOT"
@ -26,7 +30,7 @@ function getgo {
if [ "$version" = "gotip" ]; then
echo Building Go from tip
getgo $(curl https://go.dev/VERSION?m=text | head -1)
getgo $(wget -q -O - https://go.dev/VERSION?m=text | head -1)
export GOROOT_BOOTSTRAP=$GOROOT
export GOROOT=/usr/local/go/go-tip
apt-get install -y git
@ -37,9 +41,9 @@ if [ "$version" = "gotip" ]; then
else
echo Finding latest patch version for $version
echo "Go $version on $arch"
version=$(curl 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1)
version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1)
if [ "x$version" = "x" ]; then
version=$(curl 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.)' | sort -rV | head -1)
version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.)' | sort -rV | head -1)
fi
getgo $version
fi

@ -14,7 +14,15 @@ import (
protest "github.com/go-delve/delve/pkg/proc/test"
)
func mustHaveObjcopy(t *testing.T) {
t.Helper()
if objcopyPath, _ := exec.LookPath("objcopy"); objcopyPath == "" {
t.Skip("no objcopy in path")
}
}
func TestLoadingExternalDebugInfo(t *testing.T) {
mustHaveObjcopy(t)
fixture := protest.BuildFixture("locationsprog", 0)
defer os.Remove(fixture.Path)
stripAndCopyDebugInfo(fixture, t)
@ -26,6 +34,7 @@ func TestLoadingExternalDebugInfo(t *testing.T) {
}
func TestGnuDebuglink(t *testing.T) {
mustHaveObjcopy(t)
// build math.go and make a copy of the executable
fixture := protest.BuildFixture("math", 0)
buf, err := os.ReadFile(fixture.Path)

@ -4449,6 +4449,7 @@ func findSource(source string, sources []string) bool {
}
func TestListImages(t *testing.T) {
protest.MustHaveCgo(t)
pluginFixtures := protest.WithPlugins(t, protest.AllNonOptimized, "plugin1/", "plugin2/")
withTestProcessArgs("plugintest", t, ".", []string{pluginFixtures[0].Path, pluginFixtures[1].Path}, protest.AllNonOptimized, func(p *proc.Target, grp *proc.TargetGroup, fixture protest.Fixture) {
@ -4596,6 +4597,7 @@ func TestCallConcurrent(t *testing.T) {
}
func TestPluginStepping(t *testing.T) {
protest.MustHaveCgo(t)
pluginFixtures := protest.WithPlugins(t, protest.AllNonOptimized, "plugin1/", "plugin2/")
testseq2Args(".", []string{pluginFixtures[0].Path, pluginFixtures[1].Path}, protest.AllNonOptimized, t, "plugintest2", "", []seqTest{

@ -7489,6 +7489,7 @@ func TestFindInstructions(t *testing.T) {
func TestDisassembleCgo(t *testing.T) {
// Test that disassembling a program containing cgo code does not create problems.
// See issue #3040
protest.MustHaveCgo(t)
runTestBuildFlags(t, "cgodisass", func(client *daptest.Client, fixture protest.Fixture) {
runDebugSessionWithBPs(t, client, "launch",
// Launch

@ -2789,6 +2789,9 @@ func TestNonGoDebug(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip()
}
if objcopyPath, _ := exec.LookPath("cc"); objcopyPath == "" {
t.Skip("no C compiler in path")
}
dir := protest.FindFixturesDir()
path := protest.TempFile("testc")
cmd := exec.Command("cc", "-g", "-o", path, filepath.Join(dir, "test.c"))