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

3 ➡️ 4 logging #151

Merged
merged 2 commits into from
May 22, 2020
Merged

3 ➡️ 4 logging #151

merged 2 commits into from
May 22, 2020

Conversation

mabelzhang
Copy link
Contributor

@mabelzhang mabelzhang commented May 22, 2020

Address the logging test failures in #148
A lot of changes so I'm opening a PR instead of just pushing to 3_to_4 branch.

The reason that that empty path test was failing, was because we don't allow the user to use <path>, but internally we inject <path> for the plugin to read. When the test specifies <path> in an SDF, it's ignored - which means if it exists, it isn't removed. Then when LogRecord sees the tag, it doesn't know whether that <path> came from the injection (legit) or the user (or test in this case, not legit). The plugin just goes ahead and records to it, even when it came from the user.

To avoid that confusion, we can either check for user-specified <path> and strip it before adding the legit one (70c79be), which I then realized looks silly, so I just changed the tag name we inject to <record_path>. Now there won't be confusion. I added a TODO item to put it in a Component.

I also realized a lot of tests needed to be updated so that they aren't using the removed <path> feature. Two are removed because we aren't allowing SDF <path> anymore, so those two cases are no longer different from the existing ones.

P.S. I’m seeing a lot of clang_tidy warnings in many files, I don’t know if we want to fix them as we’re doing 3_to_4.

@mabelzhang mabelzhang requested a review from chapulina May 22, 2020 06:05
@codecov
Copy link

codecov bot commented May 22, 2020

Codecov Report

Merging #151 into 3_to_4 will not change coverage.
The diff coverage is 27.27%.

Impacted file tree graph

@@           Coverage Diff           @@
##           3_to_4     #151   +/-   ##
=======================================
  Coverage   65.90%   65.90%           
=======================================
  Files         128      128           
  Lines        6224     6224           
=======================================
  Hits         4102     4102           
  Misses       2122     2122           
Impacted Files Coverage Δ
src/ign.cc 26.95% <0.00%> (+0.23%) ⬆️
src/ServerPrivate.cc 68.48% <22.22%> (-0.42%) ⬇️
src/systems/log/LogRecord.cc 34.38% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eec3984...7adf761. Read the comment docs.

@mabelzhang mabelzhang added the 🔮 dome Ignition Dome label May 22, 2020
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Elegant move with the <path> -> <record_path> change! Also thanks for removing all these tests we don't need anymore.

The OSX build failure seems unrelated, but we should keep an eye on it because the log_system test has several strategically placed ifndef __APPLE__s.

@chapulina chapulina merged commit 61c9185 into 3_to_4 May 22, 2020
@chapulina chapulina deleted the 3_to_4_logging branch May 22, 2020 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants