Added three new integration test scenarios: - Test 08: Config Hot-Reload (dynamic configuration updates) - Test 09: Module Dependencies (dependency injection & cascade reload) - Test 10: Multi-Version Coexistence (canary deployment & progressive migration) Fixes: - Fixed CTest working directory for all tests (add WORKING_DIRECTORY) - Fixed module paths to use relative paths (./ prefix) - Fixed IModule.h comments for clarity New test modules: - ConfigurableModule (for config reload testing) - BaseModule, DependentModule, IndependentModule (for dependency testing) - GameLogicModuleV1/V2/V3 (for multi-version testing) Test coverage now includes 10 comprehensive integration scenarios covering hot-reload, chaos testing, stress testing, race conditions, memory leaks, error recovery, limits, config reload, dependencies, and multi-versioning. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#pragma once
|
|
#include "grove/IModule.h"
|
|
#include "grove/IDataNode.h"
|
|
#include <memory>
|
|
#include <atomic>
|
|
#include <spdlog/spdlog.h>
|
|
|
|
namespace grove {
|
|
|
|
/**
|
|
* @brief Independent module with no dependencies - serves as a witness/control
|
|
*
|
|
* This module is completely isolated from BaseModule and DependentModule.
|
|
* It should NEVER be reloaded when other modules are reloaded (unless explicitly targeted).
|
|
* Used to verify that cascade reloads don't affect unrelated modules.
|
|
*/
|
|
class IndependentModule : public IModule {
|
|
public:
|
|
// IModule interface
|
|
void process(const IDataNode& input) override;
|
|
void setConfiguration(const IDataNode& configNode, IIO* io, ITaskScheduler* scheduler) override;
|
|
const IDataNode& getConfiguration() override;
|
|
std::unique_ptr<IDataNode> getHealthStatus() override;
|
|
void shutdown() override;
|
|
std::unique_ptr<IDataNode> getState() override;
|
|
void setState(const IDataNode& state) override;
|
|
std::string getType() const override { return "IndependentModule"; }
|
|
bool isIdle() const override { return true; }
|
|
|
|
// Dependency API
|
|
std::vector<std::string> getDependencies() const override {
|
|
return {}; // No dependencies - completely isolated
|
|
}
|
|
|
|
int getVersion() const override { return version_; }
|
|
|
|
private:
|
|
int version_ = 1;
|
|
std::atomic<int> processCount_{0};
|
|
std::atomic<int> reloadCount_{0}; // Track how many times setState is called
|
|
std::unique_ptr<IDataNode> configNode_;
|
|
std::shared_ptr<spdlog::logger> logger_;
|
|
};
|
|
|
|
} // namespace grove
|
|
|
|
// Export symbols
|
|
extern "C" {
|
|
grove::IModule* createModule();
|
|
void destroyModule(grove::IModule* module);
|
|
}
|