• aard@kyu.de
    link
    fedilink
    arrow-up
    37
    ·
    1 year ago

    I recently spent about two weeks trying to figure out why an intercontinental connection between two of our sites was broken. Not really my job, I just care about application level, but the network guys were beyond useless.

    In the end I had the problem isolated to a specific network segment in India, which made them look at the right system and fix things. The reason? “We put up a firewall the day your problems started which blocks everything, if we allow your connection it works”.

  • evatronic@lemm.ee
    link
    fedilink
    English
    arrow-up
    30
    ·
    1 year ago

    The one I hate? Your unit tests pass when run locally, and in your sandbox environment, and in dev, and in UAT, but prod? Fuck that, failing with reckless abandon.

      • gornius@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I actually had to refactor configuration module some time ago. These really came in handy. But was it worth it? Well… it saved some time, the time that could be used to debug problems manually, but it made me a lot more confident that the functionality that worked before, worked after.

      • jaybone@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        You just have to mock everything, so it’s basically testing nothing. But you get those code coverage numbers.

    • fibojoly@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      The ones I have seen so far are probably written by the same people who don’t understand the usefulness of comments, I reckon. And maintained with the same enthusiasm.

    • fibojoly@sh.itjust.works
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      After many years (10+), I finally find a company that actually, really, implements CI/CD. Then I look at the tests and it’s actually the most inane shit imaginable, tacked on top of ancient existing code, not maintained. I spent more time fixing the stupid tests than actually fixing the bugs I was tasked fixing. Amazing.

    • buzziebee@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      We test the shit out of our Apis. We do more API level/integration testing though.

      I.e. a test will be something like “if the db is in this state, and we hit this endpoint with these params, does it return what we expect and update the db correctly”.

      Our app is primarily about users maintaining stuff on big datasets with complicated aggregation and approval logic. So setting up a scenario and checking the app does what the business logic says it will do is what we want to know.

      It makes refactoring wayyyyy less painful to just know that the app will always behave itself. Rather than testing whether a function can add 1 + 2 correctly, we can test each endpoint does what it’s supposed to do.

      It gives us loads of confidence that the backend is doing what it’s supposed to. If you do a huge refactor you don’t need to worry about whether you broke the test or if the test is failing correctly. If the tests all pass everything is working as it should.

      Downside is longer test execution times (because a temporary db needs set up) when running the full suite. Worth the trade off for us though.

      • jaybone@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Those are good tests. But that sounds more like an integration test than a unit test. And we should have both.

    • gerryflap@feddit.nl
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      I can’t really imagine working on any code base that has to actually be maintained and doesn’t have tests. The amount of times that tests have safed my ass at my job are uncountable

    • huginn@feddit.it
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Meanwhile I’m very upset our unit test coverage is only 40%.

      Like, it’s the number 1 priority for the principle & staff engineers to get that up to 80% across the codebase.

      • floofloof@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        And it’s number 1 priority for management to employ as few developers as possible and stretch their team as thinly as possible. Hence still no unit tests in any of the companies I’ve worked at recently, despite everyone knowing they’re worth it, including lip service from management. They just won’t invest in testing, no matter what. One company even fired all the testers then complained to the developers that the product was getting less reliable.

  • dudinax@programming.dev
    link
    fedilink
    arrow-up
    9
    ·
    1 year ago

    I’m in this meme right now.

    I just made a tiny change that somehow broke a major feature in testing. The disbelief is real.