You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the user specifies to build and execute a single unit test by issuing BUILDMODULE=**.inf (as documented in edk2), the actual unit test will not end up being executed.
@kuqin12 The reason we disable post build plugins from running is that we "promise" plugins that the entire project is built. By setting BUILDMODULE, we are no longer building the entire project, which may cause some plugins (that expect an entire build project) to fail. Due to this, we disable all post build plugins.
My suggestion here is to edit the HostUnitTestCompilerPlugin to run the plugin itself if BUILDMODULE is set. ICiBuildPlugins already have all the information needed to do this.
You can add the following code. I've already verified in successfully executes host based tests and also catches any host based test failures similar to if running all host based tests.
# Run the tests manually if only building a single module, as it will be skipped by stuart_ci_buildmod=environment.GetValue("BUILDMODULE")
if (modisnotNoneandlen(mod.strip()) >0):
forplugininPLM.GetPluginsOfClass(IUefiBuildPlugin):
ifplugin.descriptor['scope'] =='host-based-test':
ifplugin.Obj.do_post_build(uefiBuilder) !=0:
tc.SetFailed("Compile failed for {0}".format(packagename), "Compile_FAILED")
tc.LogStdError("{0} Compile failed with error code {1} ".format(AP_Path, ret))
return1
If @kuqin12 and @spbrogan are okay with it, I can put up a PR in MU_BASECORE with the change.
Describe the bug
When the user specifies to build and execute a single unit test by issuing
BUILDMODULE=**.inf
(as documented in edk2), the actual unit test will not end up being executed.This is because the "BUILDMODULE" flag will disable the post build plugins from running here and unit tests are executed as part of post build plugins: https://github.com/tianocore/edk2/blob/master/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py#L30.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The single unit test will run.
Execution environment
Windows.
The text was updated successfully, but these errors were encountered: