Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeamCity: speed up ppc64le CI #3622

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions _scripts/test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions pkg/proc/proc_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/proc/proc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions service/dap/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions service/test/integration2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down