mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-13 09:49:12 -04:00
test: Update tests
This commit is contained in:
@@ -292,6 +292,11 @@ replaced the previously exposed `ignoreManager()`.
|
||||
asserts the assistant message is stamped with the request id, history is built
|
||||
correctly (thinking + text + tool use/result), the typed event stream is emitted,
|
||||
and wire errors are categorized.
|
||||
- `BundledAgentsTest` — loads every bundled agent through the real loader (extends
|
||||
+ partials resolved from the qrc) and renders each `[body]` against the synthetic
|
||||
validation context. This is the load-time validation guarantee run in CI: a broken
|
||||
bundled body, partial, or `extends` chain fails the test instead of surfacing as a
|
||||
silent runtime drop.
|
||||
|
||||
---
|
||||
|
||||
@@ -300,8 +305,8 @@ replaced the previously exposed `ignoreManager()`.
|
||||
1. **Qt-Creator-free core build + CI** — `AgentFactory` / `ContextRenderer` still
|
||||
call `Core::ICore::userResourcePath`, so the core targets link `QtCreator::Core`.
|
||||
A `ResourcePaths` port + adapter would let the core build without Qt Creator and
|
||||
enable a CI job that fails on a layering-violating include, plus golden
|
||||
rendered-body snapshots over the bundled agents loaded through the real loader.
|
||||
enable a CI job that fails on a layering-violating include. (The bundled-agent
|
||||
render check already runs in the QtC-linked test binary — see §8.)
|
||||
2. **§9 target module layout** — the `core/ ide/ features/ hosts/` physical target
|
||||
split in `target-architecture.md` is not yet reflected in the directory layout.
|
||||
```
|
||||
|
||||
34
test/BundledAgentsTest.cpp
Normal file
34
test/BundledAgentsTest.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2024-2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <AgentConfig.hpp>
|
||||
#include <AgentLoader.hpp>
|
||||
#include <JsonPromptTemplate.hpp>
|
||||
|
||||
using QodeAssist::Agents::AgentLoader;
|
||||
using QodeAssist::Templates::JsonPromptTemplate;
|
||||
|
||||
TEST(BundledAgentsTest, AllBundledAgentsLoadResolveAndRender)
|
||||
{
|
||||
Q_INIT_RESOURCE(agents);
|
||||
|
||||
const AgentLoader::LoadResult result = AgentLoader::load(QStringLiteral(":/agents"), QString());
|
||||
|
||||
EXPECT_TRUE(result.errors.isEmpty())
|
||||
<< "bundled agent load errors: "
|
||||
<< result.errors.join(QStringLiteral("; ")).toStdString();
|
||||
|
||||
ASSERT_FALSE(result.configs.empty()) << "no bundled agents were loaded from :/agents";
|
||||
|
||||
for (const auto &cfg : result.configs) {
|
||||
QString error;
|
||||
const auto tmpl = JsonPromptTemplate::fromConfig(cfg, &error);
|
||||
EXPECT_NE(tmpl, nullptr) << "bundled agent '" << cfg.name.toStdString()
|
||||
<< "' body failed to render: " << error.toStdString();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ add_executable(QodeAssistTest
|
||||
LLMSuggestionTest.cpp
|
||||
JsonPromptTemplateTest.cpp
|
||||
ResponseRouterTest.cpp
|
||||
BundledAgentsTest.cpp
|
||||
# LLMClientInterfaceTests.cpp
|
||||
unittest_main.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user