This is an automated email from the ASF dual-hosted git repository.

Jens-G pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new a9d46268b THRIFT-6348: Go tests: stop writing ThriftTest.thrift copies 
into the source tree Client: go
a9d46268b is described below

commit a9d46268b000bac4c44052b8b42bfd8d6c4bd55a
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Sep 21 22:35:42 2026 +0200

    THRIFT-6348: Go tests: stop writing ThriftTest.thrift copies into the 
source tree
    Client: go
    
    lib/go/test wrote a filtered copy next to the sources and test/go a
    plain one; both were gitignored, so a checkout's IDL set depended on
    whether a build had run. Write the filtered copy under build/ and
    resolve the include with -I; use test/ThriftTest.thrift directly in
    test/go.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
---
 .gitignore              | 3 +--
 lib/go/test/Makefile.am | 8 ++++----
 test/go/Makefile.am     | 9 +++------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/.gitignore b/.gitignore
index efe0691ff..4607beaa6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -293,8 +293,8 @@ SKILL.md
 /lib/go/pkg
 /lib/go/src
 /lib/go/test/fuzz/gopathfuzz
+/lib/go/test/build/
 /lib/go/test/gopath/
-/lib/go/test/ThriftTest*.thrift
 /lib/nodets/test-compiled/
 /lib/ocaml/_build/
 /lib/ocaml/_tags
@@ -366,7 +366,6 @@ SKILL.md
 /test/erl/_build/
 /test/erl/rebar.lock
 /test/go/bin/
-/test/go/ThriftTest*.thrift
 /test/go/gopath
 /test/go/pkg/
 /test/go/src/code.google.com/
diff --git a/lib/go/test/Makefile.am b/lib/go/test/Makefile.am
index 1a06c2f93..1f57eee17 100644
--- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
@@ -77,10 +77,10 @@ gopath: $(THRIFT) $(THRIFTTEST) \
                                RemoteShadowClient.thrift \
                                RemoteShadowHost.thrift \
                                RemoteShadowTest.thrift
-       mkdir -p gopath/src
-       grep -v 'set<Insanity>' $(THRIFTTEST) > ThriftTest.thrift
+       mkdir -p gopath/src build
+       grep -v 'set<Insanity>' $(THRIFTTEST) > build/ThriftTest.thrift
        $(THRIFT) $(THRIFTARGS) $(RECURSIVE)
-       $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
+       $(THRIFT) $(THRIFTARGS) -I build -r IncludesTest.thrift
        $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
        $(THRIFT) $(THRIFTARGS) ContainerKeyTest.thrift
        $(THRIFT) $(THRIFTARGS_STRUCT_KEY_ENTRIES) StructKeyTest.thrift
@@ -161,7 +161,7 @@ check: gopath
        $(GO) test ./gopath/src/tests ./gopath/src/dontexportrwtest
 
 clean-local:
-       $(RM) -r gopath ThriftTest.thrift gen-go
+       $(RM) -r gopath build gen-go
 
 client: stubs
        $(GO) run TestClient.go
diff --git a/test/go/Makefile.am b/test/go/Makefile.am
index b4d4bf41a..20418aef1 100644
--- a/test/go/Makefile.am
+++ b/test/go/Makefile.am
@@ -26,14 +26,11 @@ THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
 
 precross: bin/testclient bin/testserver
 
-ThriftTest.thrift: $(THRIFTTEST)
-       cp $(THRIFTTEST) ThriftTest.thrift
-
 .PHONY: gopath
 
-gopath: $(THRIFT) ThriftTest.thrift
+gopath: $(THRIFT) $(THRIFTTEST)
        mkdir -p src/gen
-       $(THRIFTCMD) ThriftTest.thrift
+       $(THRIFTCMD) $(THRIFTTEST)
        $(THRIFTCMD) ../StressTest.thrift
        $(THRIFTCMD) ../ConstantsDemo.thrift
        touch gopath
@@ -48,7 +45,7 @@ bin/stress: gopath
        $(GO) build $(GOBUILDEXTRA) -o bin/stress ./src/bin/stress
 
 clean-local:
-       $(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath 
ThriftTest.thrift
+       $(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath
 
 check_PROGRAMS: bin/testclient bin/testserver bin/stress
 

Reply via email to