• Industrial Automation Engineer (unregistered)

    // write some comment

  • L (unregistered)

    "fortunately" in JS/TS, the 'in' operator does NOT act as substring, it checks if a property named 'test' is present in 'user' if it is an object.

    unfortunately, if user is not an object (i.e. is a string, number or boolean). it throws

  • Frederic Jones (unregistered) in reply to L

    Which also hilariously implies that there is an optionally-defined property "test" on the user object, which seems like an invitation for TS codegolf to me. Especially since we don't care what the actual value of "user.test" is.

  • LCrawford (unregistered)

    Of course they first checked a "names generator" site first to be sure that no legitimate name contains the string test.

  • (nodebb)

    The test property of the user object is set basing on a cookie.

  • (nodebb)

    Yes, good documentation for the commit is important. Alas a short (recommended 40 characters or less) message is rarely sufficient. This is why using a system that Links to the work tracking system (Azure DevOps Board, Jira, others) provides a much better solution. This also provides the means of linking together commits that are in pursuit of a common goal even if they are not consecutive.

  • (nodebb)

    Telling the testing system to bypass parts of the code that are causing the test to fail seems to be missing the whole point. If the test of expected behaviour fails for your new code, FIX THE CODE. Only bypass the tests when it can not be fully automated, like testing user interaction.

  • Kleyguerth (github) in reply to Frederic Jones

    I accidentally pressed enter and submitted the wtf form with incomplete information... The test property only exists in test accounts, it exists for when third party APIs have separate test and real endpoints, we route test accounts to the test endpoint. This is not the case for this commit, it's really bypassing a whole feature. That commit is extra fun because even when manually testing it would bypass that code and lead to different behavior.. A bug in that part of the code would be "fun" to reproduce.

  • (nodebb)

    This "fix" is as in veterinarian, not mechanic.

  • bruce.desertrat (unregistered)

    Weird, I didn't think VW programmed their diesel engine control in TypeScript!

  • (nodebb) in reply to Kleyguerth

    The test property only exists in test accounts, it exists for when third party APIs have separate test and real endpoints, we route test accounts to the test endpoint.

    Sounds like you don't have correctly separated test and production environments, since you should be getting the endpoint to use from configuration that changes depending on the environment.

    This is not the case for this commit, it's really bypassing a whole feature. That commit is extra fun because even when manually testing it would bypass that code and lead to different behavior..

    In that case, the [REDACTED] who made the commit should be sent on mandatory training to learn what unit tests are for, and why you don't disable them if the test fails.

    A bug in that part of the code would be "fun" to reproduce.

    Which is why the (...) should go on training.

  • Jeremy (unregistered)

    They changed the code not the automated tests. They should have fixed the tests though They only made sure the new code was not triggered by any of the existing tests probably rendering the tests more or less useless as they now test a code path that is not applied to a regular user.

    So the wtf is not the commit message but the commit content

  • (nodebb) in reply to Jeremy

    So the wtf is not the commit message but the commit content

    Correction: the big WTF is not the commit message but the commit content. The commit message is a small WTF because it's vague and, like bad comments, does not explain what the thing is for (i.e. it does not answer "why?").

    But it is far and far and farther than that from the worst commit message I've ever seen:

    .
    

    That's it, just a dot.

  • Shiwa (unregistered) in reply to L

    If user is a string the code will throw, but if user is a regex it will pass (as js regexes have a test method)… I feel great WTF potential in this code!

  • (nodebb) in reply to Steve_The_Cynic

    That reminds me of the time I got fed up of empty commit messages appearing in our Subversion repository. I added a pre-commit hook to reject the commit if the message was blank, and since the main culprit was a dev called Dave, the error message that was reported back was "I'm sorry Dave, I'm afraid I can't do that".

    Eventually, after he got the joke I changed it to explain why he couldn't do that.

  • Melbourne Pest Control (unregistered)
    Comment held for moderation.
  • Stamp Maker Online (unregistered)
    Comment held for moderation.
  • Kenji ROI - Amazon Product Photography (unregistered)
    Comment held for moderation.
  • codr (unregistered)
    Comment held for moderation.

Leave a comment on “Attestation”

Log In or post as a guest

Replying to comment #591006:

« Return to Article