You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by ro...@apache.org on 2026/09/04 17:34:38 UTC
(axis-axis2-c-core) 02/05: Run the HTTP/2 transport in CI as well
This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git
commit 221cbf52f6c32ad9d71ab9f82a91c6a658316277
Author: Robert Lazarski <ro...@gmail.com>
AuthorDate: Fri Sep 4 04:20:17 2026 -1000
Run the HTTP/2 transport in CI as well
The two transport configurations build disjoint test sets, and only the
HTTP/1.1 one had ever run: h2_json_integration_test,
h2_performance_benchmark_test and test_http_service_provider_interface had
no CI coverage, which is the path the JSON services actually serve. Adds a
matrix leg for --enable-http2 and libnghttp2-dev to go with it.
The two deployment tests dlopen the HTTP/1.1 sender and receiver, which that
configuration does not build, so they now skip rather than fail. The sender
one never asserted on the result at all -- it reported success with no
library present.
Co-Authored-By: Claude <no...@anthropic.com>
---
.github/workflows/asan.yml | 45 ++++++++++++++++++++++++++++-----
test/core/deployment/test_deployment.cc | 26 +++++++++++++++++++
2 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml
index 29a0bc5f1..72701682f 100644
--- a/.github/workflows/asan.yml
+++ b/.github/workflows/asan.yml
@@ -34,7 +34,26 @@ on:
jobs:
asan:
runs-on: ubuntu-latest
- name: Test suite under AddressSanitizer
+ name: ASan (${{ matrix.transport }})
+ # The two transport configurations build DISJOINT test sets, so one run
+ # cannot stand in for the other. --enable-http2 replaces the HTTP/1.1
+ # standalone-server and clientapi tests (test_client, test_clientapi,
+ # test_http_transport, test_axis2c_1355/1480/1532/1566,
+ # test_svc_client_handler_count) with the HTTP/2 ones
+ # (h2_json_integration_test, h2_performance_benchmark_test,
+ # test_http_service_provider_interface). Before this matrix only the
+ # HTTP/1.1 set ever ran, so the JSON-over-HTTP/2 path -- the one Android
+ # and the JSON services actually use -- had no CI coverage at all.
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - transport: http1
+ configure_extra: ""
+ build_samples: true
+ - transport: http2
+ configure_extra: "--enable-http2"
+ build_samples: false
# Reads the repo and uploads an artifact on failure. Nothing else.
permissions:
contents: read
@@ -53,7 +72,7 @@ jobs:
sudo apt-get install -y -qq \
build-essential autoconf automake libtool pkg-config \
libssl-dev libxml2-dev uuid-dev zlib1g-dev \
- libjson-c-dev googletest
+ libjson-c-dev googletest libnghttp2-dev
- name: Configure with AddressSanitizer
run: |
@@ -66,7 +85,8 @@ jobs:
--enable-asan \
--enable-tests \
--with-gtest=/usr/src/googletest/googletest \
- --enable-json=yes
+ --enable-json=yes \
+ ${{ matrix.configure_extra }}
- name: Build and install
run: |
@@ -75,9 +95,18 @@ jobs:
make install
- name: Build the samples
- # The integration tests call a deployed service (echo), so the samples
- # have to be built and deployed or those tests have nothing to talk to.
- # Note this runs its own install.
+ # The HTTP/1.1 integration tests call a deployed service (echo), so the
+ # samples have to be built and deployed or those tests have nothing to
+ # talk to. Note this runs its own install.
+ #
+ # Skipped under --enable-http2. That configuration cannot build the
+ # SOAP client samples at all -- the client stubs are not compiled when
+ # HTTP/2 is on (it is JSON only), so axis2_stub_get_svc_client is
+ # undefined -- and the HTTP/2 test set does not need a deployed
+ # service: verified at 39/39 against an install with zero services in
+ # it. Building user_guide alone would work but couples this job to
+ # samples/login-service, which fails -Werror on newer GCC.
+ if: ${{ matrix.build_samples }}
run: |
set -euo pipefail
cd samples
@@ -112,7 +141,9 @@ jobs:
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: asan-test-logs
+ # unique per matrix leg -- two jobs uploading the same artifact
+ # name collide and the second upload fails
+ name: asan-test-logs-${{ matrix.transport }}
path: |
**/test-suite.log
**/*.log
diff --git a/test/core/deployment/test_deployment.cc b/test/core/deployment/test_deployment.cc
index d9dbc095a..2c55f7841 100644
--- a/test/core/deployment/test_deployment.cc
+++ b/test/core/deployment/test_deployment.cc
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+#include <unistd.h>
#include <gtest/gtest.h>
#include <stdio.h>
@@ -175,6 +176,19 @@ TEST_F(TestDeployment, test_transport_receiver_load)
dll_name =
axutil_stracat(m_env, axis2c_home, "/lib/libaxis2_http_receiver.so");
printf("transport receiver name:%s\n", dll_name);
+
+ /* --enable-http2 does not build the HTTP/1.1 receiver -- the transport
+ * dirs are gated on !WITH_NGHTTP2 -- so in that configuration there is no
+ * library here to load and this test has nothing to say. Skip rather than
+ * fail: a red job in a configuration the test does not cover teaches
+ * nobody anything. */
+ if (access(dll_name, F_OK) != 0)
+ {
+ AXIS2_FREE(m_env->allocator, dll_name);
+ axutil_dll_desc_free(dll_desc, m_env);
+ GTEST_SKIP() << "libaxis2_http_receiver.so not built "
+ "(configuration used --enable-http2)";
+ }
axutil_dll_desc_set_name(dll_desc, m_env, dll_name);
axutil_dll_desc_set_type(dll_desc, m_env, AXIS2_TRANSPORT_RECV_DLL);
impl_info_param = axutil_param_create(m_env, NULL, NULL);
@@ -217,6 +231,15 @@ TEST_F(TestDeployment, test_transport_sender_load)
axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
dll_name = axutil_stracat(m_env, axis2c_home, "/lib/libaxis2_http_sender.so");
printf("transport sender name:%s\n", dll_name);
+
+ /* Same gate as the receiver above. */
+ if (access(dll_name, F_OK) != 0)
+ {
+ AXIS2_FREE(m_env->allocator, dll_name);
+ axutil_dll_desc_free(dll_desc, m_env);
+ GTEST_SKIP() << "libaxis2_http_sender.so not built "
+ "(configuration used --enable-http2)";
+ }
axutil_dll_desc_set_name(dll_desc, m_env, dll_name);
axutil_dll_desc_set_type(dll_desc, m_env, AXIS2_TRANSPORT_SENDER_DLL);
impl_info_param = axutil_param_create(m_env, NULL, NULL);
@@ -224,6 +247,9 @@ TEST_F(TestDeployment, test_transport_sender_load)
axutil_param_set_value_free(impl_info_param, m_env, axutil_dll_desc_free_void_arg);
axutil_class_loader_init(m_env);
transport_send = (axis2_transport_sender_t *) axutil_class_loader_create_dll(m_env, impl_info_param);
+ /* This test printed "successful" without ever checking the result, so it
+ * passed even when the library was missing entirely. */
+ ASSERT_NE(transport_send, nullptr);
/* TODO wrap this in something cleaner? */
DELETE_FUNCT delete_funct = axutil_dll_desc_get_delete_funct(dll_desc, m_env);