Add independent component release architecture
Modular container CI / release-build (push) Failing after 12s

This commit is contained in:
faumaray committed 2026-07-29 22:40:35 +03:00
1 parent 458dde05a6
commit 2a533a27f8
18 files changed
+2110 -216

No files matched your search

+51 -10
View File
@@ -10,13 +10,13 @@
namespace
{
struct ModuleExpectation
{
const char* path;
std::string_view moduleId;
std::string_view version;
struct ModuleExpectation {
const char* path;
std::string_view moduleId;
std::string_view stableComponentId;
std::string_view version;
};
}
} // namespace
Void::Testing::Test component_module_descriptors_are_loadable()
{
@@ -24,26 +24,31 @@ Void::Testing::Test component_module_descriptors_are_loadable()
ModuleExpectation{
.path = ECHOION_TEST_HOST,
.moduleId = "EchoionHost",
.stableComponentId = "EchoionHost",
.version = "2.0.0",
},
ModuleExpectation{
.path = ECHOION_TEST_CORE,
.moduleId = "EchoionCore",
.stableComponentId = "EchoionCore",
.version = "2.0.0",
},
ModuleExpectation{
.path = ECHOION_TEST_WEB,
.moduleId = "EchoionWeb",
.stableComponentId = "EchoionWeb",
.version = "2.0.0",
},
ModuleExpectation{
.path = ECHOION_TEST_PLUGIN_INTERNAL,
.moduleId = "url-shortener-internal",
.stableComponentId = "EchoionPluginUrlShortenerInternal",
.version = "2.0.0",
},
ModuleExpectation{
.path = ECHOION_TEST_PLUGIN_EXTERNAL,
.moduleId = "url-shortener-external",
.stableComponentId = "EchoionPluginUrlShortenerExternal",
.version = "2.0.0",
},
};
@@ -70,10 +75,10 @@ Void::Testing::Test component_module_descriptors_are_loadable()
continue;
}
Void::Testing::expect(descriptor->validate().has_value());
Void::Testing::expect_eq(
std::string_view{descriptor->module_id}, expected.moduleId);
Void::Testing::expect_eq(
descriptor->component_version.to_string(), expected.version);
Void::Testing::expect_eq(std::string_view{descriptor->module_id},
expected.moduleId);
Void::Testing::expect_eq(descriptor->component_version.to_string(),
expected.version);
auto module = descriptor->create();
Void::Testing::expect(module != nullptr);
@@ -81,6 +86,42 @@ Void::Testing::Test component_module_descriptors_are_loadable()
Void::Testing::expect_eq(module->name(), expected.moduleId);
}
module.reset();
const auto stableQuery =
reinterpret_cast<echoion_module_abi_query_fn_v1>(
dlsym(library, Echoion::Api::Module::stableQuerySymbol));
Void::Testing::expect(stableQuery != nullptr);
if (stableQuery != nullptr) {
const echoion_module_descriptor_v1* stable = stableQuery();
Void::Testing::expect(stable != nullptr);
if (stable != nullptr) {
Void::Testing::expect_eq(stable->struct_size,
sizeof(echoion_module_descriptor_v1));
Void::Testing::expect_eq(stable->abi_version,
ECHOION_MODULE_ABI_VERSION);
Void::Testing::expect_eq(
std::string_view{stable->component_id.data,
stable->component_id.size},
expected.stableComponentId);
Void::Testing::expect_eq(stable->version_major, 2U);
Void::Testing::expect_eq(stable->version_minor, 0U);
Void::Testing::expect_eq(stable->version_patch, 0U);
Void::Testing::expect(stable->api != nullptr);
if (stable->api != nullptr) {
Void::Testing::expect_eq(stable->api->struct_size,
sizeof(echoion_module_api_v1));
Void::Testing::expect(stable->api->create != nullptr);
Void::Testing::expect(stable->api->destroy != nullptr);
echoion_module_instance_v1 instance = nullptr;
const auto status = stable->api->create(nullptr, &instance);
Void::Testing::expect_eq(status, ECHOION_STATUS_OK_V1);
Void::Testing::expect(instance != nullptr);
if (instance != nullptr) {
stable->api->destroy(instance);
}
}
}
}
dlclose(library);
}
}