Skip to content

Enable logger in UMF tests #470

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

Closed
wants to merge 1 commit into from

Conversation

kswiecicki
Copy link
Contributor

@kswiecicki kswiecicki commented May 7, 2024

It's easier to spot the cause of errors in tests with log messages.

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@kswiecicki kswiecicki marked this pull request as ready for review May 7, 2024 11:55
@kswiecicki kswiecicki requested a review from a team as a code owner May 7, 2024 11:55
@@ -75,6 +75,10 @@ function(add_umf_test)
COMMAND ${TEST_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set_property(
TEST ${TEST_NAME}
PROPERTY ENVIRONMENT "UMF_LOG=level:debug\;flush:debug\;output:stdout")
Copy link
Contributor

Choose a reason for hiding this comment

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

ohh, I'm lovin' it! 😄

will this work with set_tests_properties down below, though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be merged leaving just set_tests_properties and providing two properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I've merged it.

@@ -75,6 +75,10 @@ function(add_umf_test)
COMMAND ${TEST_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set_property(
Copy link
Contributor

Choose a reason for hiding this comment

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

can you pls do similar change for add_umf_benchmark and in examples/CMakeLists.txt?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this can ever be overridden by setting environment variables for scenarios where we would like to have different logging options

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid Rafał is right - we can't easily override the value...
I'm not sure how important of use case is that, though... but perhaps we should do this only on CI level.

When I finally add the script to run tests on CI we could set the logger there. For now, if needed we could set the logger in all workflows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll refrain from adding similar change to add_umf_benchmark then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, due to the inflexibility of my change, I'll close this PR. Eventual logging changes will be done after @lukaszstolarczuk's CI script.

@@ -75,6 +75,10 @@ function(add_umf_test)
COMMAND ${TEST_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set_property(
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this can ever be overridden by setting environment variables for scenarios where we would like to have different logging options

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.

4 participants