From dfbbb7b6d4af9851715d68a9c8ac612b21592ee6 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 8 Nov 2018 18:11:12 +0000 Subject: [PATCH] go/packages, go/analysis/internal/unitchecker: skip broken tests for now Updates golang/go#28609 Updates golang/go#28676 Change-Id: Id0fbc6cb0ce14aed9b20afcd0488708df33d5a62 Reviewed-on: https://go-review.googlesource.com/c/148637 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- .../internal/unitchecker/unitchecker_test.go | 2 ++ go/packages/packages_test.go | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/go/analysis/internal/unitchecker/unitchecker_test.go b/go/analysis/internal/unitchecker/unitchecker_test.go index a00ce4f2..7466cd8d 100644 --- a/go/analysis/internal/unitchecker/unitchecker_test.go +++ b/go/analysis/internal/unitchecker/unitchecker_test.go @@ -63,6 +63,8 @@ func main() { // analysis with facts using unitchecker under "go vet". // It fork/execs the main function above. func TestIntegration(t *testing.T) { + t.Skip("skipping broken test; golang.org/issue/28676") + if runtime.GOOS != "linux" { t.Skipf("skipping fork/exec test on this platform") } diff --git a/go/packages/packages_test.go b/go/packages/packages_test.go index 275e8899..f2399e84 100644 --- a/go/packages/packages_test.go +++ b/go/packages/packages_test.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "go/ast" + "go/build" constantpkg "go/constant" "go/parser" "go/token" @@ -1221,6 +1222,9 @@ func TestName_ModulesDedup(t *testing.T) { func TestJSON(t *testing.T) { packagestest.TestAll(t, testJSON) } func testJSON(t *testing.T, exporter packagestest.Exporter) { + if !haveReleaseTag("go1.11") { + t.Skip("skipping; flaky before Go 1.11; https://golang.org/issue/28609") + } //TODO: add in some errors exported := packagestest.Export(t, exporter, []packagestest.Module{{ Name: "golang.org/fake", @@ -1616,3 +1620,12 @@ func constant(p *packages.Package, name string) *types.Const { } return c.(*types.Const) } + +func haveReleaseTag(tag string) bool { + for _, v := range build.Default.ReleaseTags { + if tag == v { + return true + } + } + return false +}