apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
160 stars 85 forks source link

run_unit_test_discovery_zeroconf failure in Conan2 port branch #618

Open PengZheng opened 11 months ago

PengZheng commented 11 months ago
[ RUN      ] DiscoveryZeroconfAnnouncerTestSuite.AddAndRemoveEndpoint
[2023-08-20T12:42:38] [   info] [celix_framework] [framework_start:476] Celix framework started
[2023-08-20T12:42:38] [  error] [DiscoveryZeroconf] Announcer: Failed to create connection for DNS service, -65563.
[2023-08-20T12:42:38] [   info] [DiscoveryZeroconf] Announcer: Add endpoint for dzc_test_service(60f49d89-d105-430c-b12b-93fbb54b1d19).
[2023-08-20T12:42:38] [  error] [DiscoveryZeroconf] Announcer: Failed to create connection for DNS service, -65563.
/home/runner/work/celix/celix/bundles/remote_services/discovery_zeroconf/gtest/src/DiscoveryZeroconfAnnouncerTestSuite.cc:218: Failure
Expected equality of these values:
  dnsErr
    Which is: -65563
  kDNSServiceErr_NoError
    Which is: 0
[2023-08-20T12:42:38] [   info] [DiscoveryZeroconf] Announcer: Remove endpoint for dzc_test_service(60f49d89-d105-430c-b12b-93fbb54b1d19).
[2023-08-20T12:42:38] [  error] [DiscoveryZeroconf] Announcer: Failed to create connection for DNS service, -65563.
[  FAILED  ] DiscoveryZeroconfAnnouncerTestSuite.AddAndRemoveEndpoint (6 ms)

https://github.com/apache/celix/tree/feature/483-conan-2-support CI still uses Conan 1 to run these tests.

The test failed because it failed to find mdnsd. The test specify mdnsd's location by -DMDNSD="${DNSSD_LIB_DIRS}/../bin/mdnsd", and Conan2 generators does not have DNSSD_LIB_DIRS.

Currently, I replace DNSSD_LIB_DIRS by DNSSD_INCLUDE_DIR as a stop gap. But a proper fix IMO should use information provided by Conan @xuzhenbao:

        # add path for daemon (mdnsd, mDNSResponder) and client (dns-sd)
        bin_path = os.path.join(self.package_folder, "bin")
        self.output.info("Appending PATH environment variable: {}".format(bin_path))
        self.env_info.PATH.append(bin_path)