Live data from Hacker News

Diagnosing a Linux-only unit test failure

codeblog.jonskeet.uk

1–10 of 25 posts

Re: Diagnosing a Linux-only unit test failure

#2
Not directly related to the article, but string interpolation in code samples in step 6 looks somewhat unreadable without proper syntax coloring:

  Console.WriteLine($"lhs=({lhs.x}, {lhs.y}); rhs=({rhs.x}, {rhs.y})");
  Console.WriteLine($"{lhs.x == rhs.x}, {lhs.y == rhs.y}");

Re: Diagnosing a Linux-only unit test failure

#3
post #2

Not directly related to the article, but string interpolation in code samples in step 6 looks somewhat unreadable without proper syntax coloring: Console.WriteLine($"lhs=({lhs.x}, {lhs.y}); rhs=({rhs.x}, {rhs.y})"); Console.WriteLine($"{lhs.x == rhs.x}, {lhs.y == rhs.y}");

They look fine to me, but I guess it helps that both Python and Rust use the same interpolation style.

Re: Diagnosing a Linux-only unit test failure

#6
> Tests that only fail in CI are really annoying. I’ve had this a couple of times, and it’s always taken hours to sort out, because the “try something, get results, think about what they mean” cycle is so slow.

To address this, CircleCI has an interesting feature where you can enable SSH access to the build, so one can investigate locally (relative to the build) instead of repeatedly throwing code over the wall and waiting for something remotely meaningful to come back in logs.

Re: Diagnosing a Linux-only unit test failure

#7
post #3
post #2

Not directly related to the article, but string interpolation in code samples in step 6 looks somewhat unreadable without proper syntax coloring: Console.WriteLine($"lhs=({lhs.x}, {lhs.y}); rhs=({rhs.x}, {rhs.y})"); Console.WriteLine($"{lhs.x == rhs.x}, {lhs.y == rhs.y}");

They look fine to me, but I guess it helps that both Python and Rust use the same interpolation style.

Err... do either python or rust allow this style, in both languages I've always used

    ("lhs=({}, {}); rhs=({}, {})", lhs.x, lhs.y, rhs.x, rhs.y)

Re: Diagnosing a Linux-only unit test failure

#8
post #7
post #3

Earlier quoted context omitted.

They look fine to me, but I guess it helps that both Python and Rust use the same interpolation style.

Err... do either python or rust allow this style, in both languages I've always used ("lhs=({}, {}); rhs=({}, {})", lhs.x, lhs.y, rhs.x, rhs.y)

Python added "f strings" recently (read: in 2015)[1], which look like

    f"{some_var}"
which evaluates "some_var" in the local scope. Sort of like Ruby's "#{...}" (if I'm remembering that syntax correctly). Rust supports named parameters in format strings[2] but that's not quite the same.

[1]: https://www.python.org/dev/peps/pep-0498/ [2]: https://doc.rust-lang.org/std/fmt/#named-parameters

Post reply on HN