From 37ba8d5b0c7e52814b761d4166fe93ff91df7fdd Mon Sep 17 00:00:00 2001 From: Jamy Timmermans Date: Mon, 4 Dec 2023 16:04:22 -0800 Subject: [PATCH] featu(packagesdriver): add _test suffix to pkgPath --- go/tools/gopackagesdriver/flatpackage.go | 2 +- tests/integration/gopackagesdriver/gopackagesdriver_test.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go/tools/gopackagesdriver/flatpackage.go b/go/tools/gopackagesdriver/flatpackage.go index b30b80d2b4..079627ce15 100644 --- a/go/tools/gopackagesdriver/flatpackage.go +++ b/go/tools/gopackagesdriver/flatpackage.go @@ -154,7 +154,7 @@ func (fp *FlatPackage) MoveTestFiles() *FlatPackage { return &FlatPackage{ ID: fp.ID + "_xtest", Name: fp.Name + "_test", - PkgPath: fp.PkgPath, + PkgPath: fp.PkgPath + "_test", Imports: newImports, Errors: fp.Errors, GoFiles: append([]string{}, xtgf...), diff --git a/tests/integration/gopackagesdriver/gopackagesdriver_test.go b/tests/integration/gopackagesdriver/gopackagesdriver_test.go index 4b89322efa..86c93a4d2b 100644 --- a/tests/integration/gopackagesdriver/gopackagesdriver_test.go +++ b/tests/integration/gopackagesdriver/gopackagesdriver_test.go @@ -175,6 +175,9 @@ func TestExternalTests(t *testing.T) { for _, p := range resp.Packages { if p.ID == xTestId { + if !strings.HasSuffix(p.PkgPath, "_test") { + t.Errorf("PkgPath missing _test suffix") + } assertSuffixesInList(t, p.GoFiles, "/hello_external_test.go") } else if p.ID == testId { assertSuffixesInList(t, p.GoFiles, "/hello.go", "/hello_test.go")