Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work to get C++ unit tests working in Linux CI #85

Merged
merged 21 commits into from
Sep 17, 2020

Conversation

bpkroth
Copy link
Contributor

@bpkroth bpkroth commented Sep 17, 2020

This is initial work to get C++ UnitTests (Mlos.UnitTest and SmartCache) working in Linux CI.

Main other issues it addresses:

  • Provide a mechanism for Linux to discover where to find the SettingsRegistry assemblies for the Mlos.Agent to load
  • DEBUG compile definition for MSVC compatibility
  • Skip (and comment) some failing unit tests on the dotnet side

There are some known issues with it, that @grlap and I discussed addressing in future PR:

  • print statements are not configurable, so while the output may be helpful in an interactive development environment, they aren't suitable for a service/daemon environment
  • there are some security concerns for loading settings registry DLLs are runtime
    • one solution there is to give the agent a config mechanism (file or args) to be able to choose whether it will allow runtime loadable DLLs at all

Note: cake doesn't currently provide a ctest target, so we just call the
virtual "test" target that cmake generates to do the same.
…t.Server

FIXME: as with Mlos.UnitTest - it currently hangs
it's pure c# and called from the "dotnet test" target.
temporarily disabling since they're broken
Typically, clang/gcc only define NDEBUG for Release builds, but don't
define DEBUG for other (e.g. Debug) builds.

This is to replicate MSVC behavior which defines DEBUG for Debug builds.

Without this, some UnitTests which were only supposed to run for Retail
builds due to failing asserts otherwise were getting build
unintentionally.
The previous method didn't work because for a binary named
"Mlos.UnitTest" standard path parsing tools think the extension is
".UnitTest"
… Linux environments

plus some other comments about eventual other fixups
This is a hack around the fact that we currently need to cleanup all of
the shared memory regions after ourselves before we can do another (or
different) run.
@bpkroth bpkroth requested review from grlap and a team September 17, 2020 15:47
@bpkroth bpkroth merged commit 56e9517 into microsoft:main Sep 17, 2020
@bpkroth bpkroth deleted the bpkroth/linux-work branch March 20, 2023 15:54
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.

2 participants