-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Try to add cpp cross tests #3164
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
Changes from all commits
5329796
5ae0e1a
63a37e7
c29b4ec
9521348
f673f4d
f4cf10e
54a2210
764e213
f8e6ec8
a4aee68
dbb2c52
5b067a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ env: | |
| --without-lua | ||
| --without-rs | ||
| --without-swift | ||
| --without-cl | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
@@ -552,20 +553,86 @@ jobs: | |
| - name: Run ts tests | ||
| run: make -C lib/nodets check | ||
|
|
||
| lib-cpp: | ||
| needs: compiler | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update -yq | ||
| sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS locales | ||
| sudo locale-gen en_US.UTF-8 | ||
| sudo locale-gen de_DE.UTF-8 | ||
| sudo update-locale | ||
|
|
||
| - name: Run bootstrap | ||
| run: ./bootstrap.sh | ||
|
|
||
| - name: Run configure | ||
| run: | | ||
| ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-cpp/with-cpp/g') | ||
|
|
||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: thrift-compiler | ||
| path: compiler/cpp | ||
|
|
||
| - name: Run thrift-compiler | ||
| run: | | ||
| chmod a+x compiler/cpp/thrift | ||
| compiler/cpp/thrift -version | ||
|
|
||
| - name: Run make for cpp | ||
| run: make -j$(nproc) -C lib/cpp | ||
|
|
||
| - name: Run make check for lib/cpp | ||
| run: make -j$(nproc) -C lib/cpp check | ||
|
|
||
| - name: Run make check for test/cpp | ||
| run: make -j$(nproc) -C test/cpp check | ||
|
|
||
| - name: Run make precross for cpp test | ||
| run: make -j$(nproc) -C test/cpp precross | ||
|
|
||
| - name: Upload cpp precross artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cpp-precross | ||
| if-no-files-found: error | ||
| include-hidden-files: true | ||
| path: | | ||
| test/cpp/TestClient | ||
| test/cpp/TestServer | ||
| test/cpp/.libs/TestClient | ||
| test/cpp/.libs/TestServer | ||
| lib/cpp/.libs/*.so | ||
| retention-days: 3 | ||
|
|
||
| - name: Upload log files from failed test runs | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: lib-cpp-test-log | ||
| path: lib/cpp/test/*.xml | ||
| retention-days: 3 | ||
|
|
||
| cross-test: | ||
| needs: | ||
| - lib-java-kotlin | ||
| #- lib-swift # swift is currently broken and no maintainers around -> see THRIFT-5864 | ||
| - lib-rust | ||
| - lib-go | ||
| - lib-python | ||
| - lib-cpp | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| matrix: | ||
| # swift is currently broken and no maintainers around -> see THRIFT-5864 | ||
| server_lang: ['java', 'kotlin', 'go', 'rs'] # ['java', 'kotlin', 'go', 'rs', 'swift'] | ||
| server_lang: ['java', 'kotlin', 'go', 'rs', 'cpp'] # ['java', 'kotlin', 'go', 'rs', 'swift'] | ||
| # we always use comma join as many client langs as possible, to reduce the number of jobs | ||
| client_lang: ['java,kotlin', 'go,rs'] # ['java,kotlin', 'go,rs', 'swift'] | ||
| client_lang: ['java,kotlin', 'go,rs,cpp'] # ['java,kotlin', 'go,rs', 'swift'] | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
@@ -577,14 +644,17 @@ jobs: | |
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| # here we intentionally use an older version so that we also verify Java 17 compiles to it | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this comment actually true?
Which proves the statement wrong
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment about java 17 is probably a typo? the one we want to make sure is probably java 7 not 17? I can't remember the exact details but I think we do want to maintain compatibility with older lts java versions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @jimexist to chime in.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was not a typo. that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jimexist Thanks for dropping in and the update: I want to drop this change from my PR since it does not belong, but what is the correct fix for this that should go into the repo to ensure that java/kotlin tests pass without this issue?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created a ticket: THRIFT-5879: java and kotlin cross tests fail in the GitHub action |
||
| java-version: 8 | ||
| java-version: 17 | ||
| cache: "gradle" | ||
|
|
||
| - name: Install openssl and certificates (for SSL tests) | ||
| run: | | ||
| sudo apt-get update -yq | ||
| sudo apt-get install -y --no-install-recommends openssl ca-certificates | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| openssl \ | ||
| ca-certificates \ | ||
| libboost-all-dev \ | ||
| libevent-dev | ||
|
|
||
| - name: Download java precross artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -617,6 +687,12 @@ jobs: | |
| name: go-precross | ||
| path: test/go/bin | ||
|
|
||
| - name: Download cpp precross artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: cpp-precross | ||
| path: . | ||
|
|
||
| - name: Set back executable flags | ||
| run: | | ||
| chmod a+x lib/java/build/run* | ||
|
|
@@ -625,6 +701,9 @@ jobs: | |
| # THRIFT-5864 chmod a+x test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* | ||
| chmod a+x test/rs/bin/* | ||
| chmod a+x test/go/bin/* | ||
| chmod a+x test/cpp/* | ||
| chmod a+x test/cpp/.libs/* | ||
| chmod a+x lib/cpp/.libs/*.so | ||
|
|
||
| - name: Create tmp domain socket folder | ||
| run: mkdir /tmp/v0.16 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,6 +146,10 @@ uint32_t THeaderProtocol::writeBinary(const std::string& str) { | |
| return proto_->writeBinary(str); | ||
| } | ||
|
|
||
| uint32_t THeaderProtocol::writeUUID(const TUuid& uuid) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Jens-G This is a bugfix for the THeaderProtocol.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think either way is fine. |
||
| return proto_->writeUUID(uuid); | ||
| } | ||
|
|
||
| /** | ||
| * Reading functions | ||
| */ | ||
|
|
@@ -246,6 +250,10 @@ uint32_t THeaderProtocol::readString(std::string& str) { | |
| uint32_t THeaderProtocol::readBinary(std::string& binary) { | ||
| return proto_->readBinary(binary); | ||
| } | ||
|
|
||
| uint32_t THeaderProtocol::readUUID(TUuid& uuid) { | ||
| return proto_->readUUID(uuid); | ||
| } | ||
| } | ||
| } | ||
| } // apache::thrift::protocol | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,12 @@ class TProtocolTap : public TVirtualProtocol<TProtocolTap> { | |
| return rv; | ||
| } | ||
|
|
||
| uint32_t readUUID(TUuid& uuid) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just saw this as missing, I will see if it makes sense to add a test for this protocol since I see there aren't any |
||
| uint32_t rv = source_->readUUID(uuid); | ||
| sink_->writeUUid(uuid); | ||
| return rv; | ||
| } | ||
|
|
||
| private: | ||
| std::shared_ptr<TProtocol> source_; | ||
| std::shared_ptr<TProtocol> sink_; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,10 +202,10 @@ BOOST_AUTO_TEST_CASE( JSON_BufferedHTTP ) | |
| #endif | ||
|
|
||
| { | ||
| std::shared_ptr<TSocket> socket(new TSocket("localhost", port)); | ||
| std::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", port)); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to be an issue with Or one that knows more about IPv6 and the socket libs used can perhaps see if this can be fixed in the library; I don't know enough of IPv6 and the libraries used to know if this is even an option |
||
| socket->setRecvTimeout(10000) ; // 1000msec should be enough | ||
| std::shared_ptr<TBlockableBufferedTransport> blockable_transport(new TBlockableBufferedTransport(socket)); | ||
| std::shared_ptr<TTransport> transport(new THttpClient(blockable_transport, "localhost", "/service")); | ||
| std::shared_ptr<TTransport> transport(new THttpClient(blockable_transport, "127.0.0.1", "/service")); | ||
| std::shared_ptr<TProtocol> protocol(new TJSONProtocol(transport)); | ||
| onewaytest::OneWayServiceClient client(protocol); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.