Skip to content

Commit d696a0b

Browse files
authored
Reset pack filter flag on loading solution and running convert
1 parent 76133e2 commit d696a0b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tools/projmgr/src/ProjMgrRpcServer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ RpcArgs::SuccessResult RpcHandler::LoadPacks(void) {
286286
}
287287

288288
RpcArgs::SuccessResult RpcHandler::LoadSolution(const string& solution, const string& activeTarget) {
289+
m_bUseAllPacks = false; // loading solution will first use only listed packs
289290
m_packReferences.clear();
290291
RpcArgs::SuccessResult result = {false};
291292
const auto csolutionFile = RteFsUtils::MakePathCanonical(solution);
@@ -846,6 +847,9 @@ RpcArgs::ConvertSolutionResult RpcHandler::ConvertSolution(const string& solutio
846847
if(!CheckSolutionArg(csolutionFile, result.message)) {
847848
return result;
848849
}
850+
m_bUseAllPacks = false; // loading solution will first use only listed packs
851+
m_packReferences.clear(); // will be updated
852+
849853
if(!m_manager.RunConvert(csolutionFile, activeTarget, updateRte) || !ProjMgrLogger::Get().GetErrors().empty()) {
850854
if(m_worker.HasVarDefineError()) {
851855
const auto& vars = m_worker.GetUndefLayerVars();

tools/projmgr/test/src/ProjMgrRpcTests.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,28 @@ TEST_F(ProjMgrRpcTests, RpcResolveComponents) {
539539
EXPECT_FALSE(responses[4]["result"].contains("validation"));
540540
}
541541

542+
TEST_F(ProjMgrRpcTests, RpcGetComponentsTree) {
543+
string context = "selectable+CM0";
544+
vector<string> contextList = {
545+
context
546+
};
547+
string csolution = "/Validation/dependencies.csolution.yml";
548+
auto requests = CreateLoadRequests(csolution, "", contextList);
549+
requests += FormatRequest(3, "GetComponentsTree", json({{ "context", context }, {"all", true}}));
550+
requests += FormatRequest(4, "GetComponentsTree", json({{ "context", context }, {"all", false}}));
551+
requests += FormatRequest(5, "LoadSolution", json({{ "solution", testinput_folder + csolution }, { "activeTarget", "" }}));
552+
requests += FormatRequest(6, "GetComponentsTree", json({{ "context", context }, {"all", true}}));
553+
554+
const auto& responses = RunRpcMethods(requests);
555+
556+
auto size3 = responses[2]["result"]["classes"].size();
557+
auto size4 = responses[3]["result"]["classes"].size();
558+
auto size6 = responses[5]["result"]["classes"].size();
559+
EXPECT_TRUE(size3 > size4); // there are more components in all packs that in packs listed in solution
560+
EXPECT_EQ(size3, size6); // after solution reload, all components can be requested
561+
}
562+
563+
542564
TEST_F(ProjMgrRpcTests, RpcSelectComponent) {
543565
string context = "selectable+CM0";
544566
vector<string> contextList = {

0 commit comments

Comments
 (0)