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

More spdlog tests #40

Merged
merged 8 commits into from
Jun 4, 2020
Merged

More spdlog tests #40

merged 8 commits into from
Jun 4, 2020

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Jun 2, 2020

As suggested in #36 (comment), some of this approach takes after #37.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-coverage Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay added enhancement New feature or request in review labels Jun 2, 2020
@cottsay cottsay requested a review from ahcorde June 2, 2020 21:48
@cottsay cottsay self-assigned this Jun 2, 2020
Comment on lines +54 to +56
} else if (severity == 0 && level == 10) {
// This is a special case - not sure what the right behavior is
expected_log << ss.str() << std::endl;
Copy link
Member Author

Choose a reason for hiding this comment

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

I called this out on Slack - not sure what the expected behavior should be here, so for now I'm just asserting the current behavior.

Comment on lines 81 to 103
std::stringstream dir_command;
dir_command << "dir";
#ifdef _WIN32
dir_command << " /B";
#endif
dir_command << " " << (log_dir / get_expected_log_prefix()).string() << "*";

FILE * fp = popen(dir_command.str().c_str(), "r");
if (nullptr == fp) {
throw std::runtime_error("Failed to glob for log files");
}

char raw_line[2048];
while (fgets(raw_line, sizeof(raw_line), fp) != NULL) {
pclose(fp);

std::string line(raw_line);
fs::path line_path(line.substr(0, line.find_last_not_of(" \t\r\n") + 1));
// This should be changed once ros2/rcpputils#68 is resolved
return line_path.is_absolute() ? line_path : log_dir / line_path;
}

pclose(fp);
Copy link
Member Author

@cottsay cottsay Jun 2, 2020

Choose a reason for hiding this comment

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

Pretty much all of this should be replaced with properly iterating the directory content to find the log file, but that functionality isn't available in the filesystem helper. So either we need to implement it, or we need to bump to C++17, because this is kinda gross. (Post-Foxy)

Comment on lines 110 to 117
char * exe_name = rcutils_get_executable_name(allocator);
if (nullptr == exe_name) {
throw std::runtime_error("Failed to determine executable name");
}
std::stringstream prefix;
prefix << exe_name << "_" <<
rcutils_get_pid() << "_";
allocator.deallocate(exe_name, allocator.state);
Copy link
Member Author

@cottsay cottsay Jun 2, 2020

Choose a reason for hiding this comment

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

We should support get_executable_name in rcpputils to avoid the need for an allocator here. Post-Foxy, of course.

@cottsay cottsay requested a review from jacobperron June 2, 2020 21:56
Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Scott K Logan <logans@cottsay.net>
rcl_logging_spdlog/test/fixtures.hpp Outdated Show resolved Hide resolved
rcl_logging_spdlog/test/fixtures.hpp Outdated Show resolved Hide resolved
rcl_logging_spdlog/test/test_logging_interface.cpp Outdated Show resolved Hide resolved
Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay requested a review from hidmic June 2, 2020 22:29
@jacobperron jacobperron added this to In progress in Foxy Patch Release 1 via automation Jun 2, 2020
@jacobperron
Copy link
Member

I haven't reviewed the changes closely, but you have my blessing to merge pending approval. Since it's only test code, I think it's okay delay it's release into Foxy.

@cottsay cottsay removed the request for review from jacobperron June 2, 2020 22:33
Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Scott K Logan <logans@cottsay.net>
Foxy Patch Release 1 automation moved this from In progress to Reviewer approved Jun 4, 2020
Signed-off-by: Scott K Logan <logans@cottsay.net>
Copy link
Contributor

@Blast545 Blast545 left a comment

Choose a reason for hiding this comment

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

LGTM

@cottsay cottsay removed the request for review from ahcorde June 4, 2020 22:32
@cottsay cottsay merged commit c1bfac6 into master Jun 4, 2020
Foxy Patch Release 1 automation moved this from Reviewer approved to Done Jun 4, 2020
@delete-merged-branch delete-merged-branch bot deleted the more_spdlog_tests branch June 4, 2020 22:37
@jacobperron jacobperron moved this from Released to Needs backport in Foxy Patch Release 1 Jun 5, 2020
@clalancette clalancette mentioned this pull request Jun 8, 2020
@jacobperron jacobperron removed this from Needs backport in Foxy Patch Release 1 Jul 10, 2020
@jacobperron jacobperron added this to Proposed in Foxy Patch Release 2 via automation Jul 10, 2020
@jacobperron jacobperron moved this from Proposed to Needs backport in Foxy Patch Release 2 Jul 10, 2020
@jacobperron jacobperron removed this from Needs backport in Foxy Patch Release 2 Aug 7, 2020
@jacobperron jacobperron added this to Proposed in Foxy Patch Release 3 via automation Aug 7, 2020
@jacobperron jacobperron moved this from Proposed to Needs backport in Foxy Patch Release 3 Aug 7, 2020
ahcorde pushed a commit that referenced this pull request Oct 8, 2020
Signed-off-by: Scott K Logan <logans@cottsay.net>
ahcorde pushed a commit that referenced this pull request Oct 9, 2020
Signed-off-by: Scott K Logan <logans@cottsay.net>
@jacobperron jacobperron removed this from Needs backport in Foxy Patch Release 3 Oct 9, 2020
@jacobperron jacobperron added this to Proposed in Foxy Patch Release 4 via automation Oct 9, 2020
@jacobperron jacobperron moved this from Proposed to Needs backport in Foxy Patch Release 4 Oct 9, 2020
@jacobperron jacobperron moved this from Needs backport to Needs release in Foxy Patch Release 4 Nov 10, 2020
@jacobperron jacobperron moved this from Needs release to Released in Foxy Patch Release 4 Dec 11, 2020
@jacobperron jacobperron removed this from Released in Foxy Patch Release 4 Dec 11, 2020
@jacobperron jacobperron added this to Proposed in Foxy Patch Release 5 via automation Dec 11, 2020
@jacobperron jacobperron moved this from Proposed to Needs release in Foxy Patch Release 5 Dec 11, 2020
@jacobperron jacobperron moved this from Needs release to Released in Foxy Patch Release 5 Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants