Skip to content

Conversation

@rowo360
Copy link
Contributor

@rowo360 rowo360 commented Jan 2, 2026

This PR fixes #1408 by restoring all top level package settings when loading a package.

The core change is located in method TestCentricProject.Load(). It contains additional these statements now, which are responsible to apply all top level settings from the loaded package to the current (this pointer) package.

foreach (PackageSetting packageSetting in newPackage.Settings)
    Settings.Set(packageSetting);

Besides this change I need to slightly adapt the UI as well: the checked state of the RunAsX86 menu item, must be updated from the package settings whenever we load a project. This worked almost straight forward, besides that a reload is invoked whenever the checked state of this menu item is changed. So, I need to add some additional statements to avoid this unnecessary reload operation here.

One remark to the changes in method TestCentricPresenter.ChangePackageSettingAndReload():
I simplified that one: the 'DEFAULT' case could be removed because it's for the AgentSelection, but that is handled by the AgentSelectionController class in the meantime. Also I removed the settings.Remove() case, because we don't remove any settings in other locations, but simply applying the values. Hope, that's ok!

@rowo360
Copy link
Contributor Author

rowo360 commented Jan 2, 2026

This is something I didn't change, but based on our observations, it might be a good idea to check it again. Are these settings properly applied to the correct level?

  • RunAsX86 => TopLevel setting
  • TestParameters => TopLevel setting

Command line options:

  • InternalTraceLevel => setting applied to all subpackages
  • WorkDirectory => setting applied to all subpackages
  • DebugAgent => setting applied to all subpackages

@rowo360
Copy link
Contributor Author

rowo360 commented Jan 2, 2026

Here's one considerations for an improvement on code level. It's about the method TestCentricProject.Load(). I wonder if we should make this method static and returning a new TestCentricProject instance:

public static TestCentricProject Load(string path) 

I think that we have not yet clearly defined what should happen to existing settings or subpackages when the Load() method is called on an existing project. That's not an issue currently for our productive code, because the Load() method is invoked only from one code location and right after creating a new project. So, there are no existing settings or subpackages in this case.

But I noticed it while writing some unit tests. I loaded a project file and assert for some settings, but failed to notice that the settings were not set from the Load() call, but instead from my arrange statements. Well, the test passed, but not exactly in the indented manner.

@rowo360 rowo360 self-assigned this Jan 2, 2026
@rowo360 rowo360 requested a review from CharliePoole January 2, 2026 14:30
Copy link
Member

@CharliePoole CharliePoole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this solves your issue, I'm OK with it. Let's try not to make too many changes to the design of TestCentricProject until we complete #1214. I just noticed I never labeled it to indicate it's importance and did so now. I'd like to resolve the design definitively for beta8 and implement as much of what we decide as possible. I'll add a new comment to sum up and restart the discussion.

}


[Test]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestCase attributes are sufficient.

_view.Received().Title = "TestCentric - TestCentric.tcproj";
}

[Test]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@rowo360
Copy link
Contributor Author

rowo360 commented Jan 2, 2026

Okay, I agree! I'll merge this PR (without any further changes), then work next on #1406 (because we already discussed and agreed that those settings should be removed from our application settings) and then come back to issue #1214.

@rowo360 rowo360 merged commit 2af48eb into main Jan 3, 2026
2 checks passed
@rowo360 rowo360 deleted the issue-1408 branch January 3, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TopLevel TestPackage settings are not restored when loading tcproj file

3 participants