• Fal@yiffit.net
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    6
    ·
    8 months ago

    At my work, we have a big Rails app with lots of tests

    Of course they need a blog post to get test times down to something that’s already way too slow. Ruby and Rails are such a dumpster fires

    • vext01@lemmy.sdf.org
      link
      fedilink
      arrow-up
      6
      ·
      8 months ago

      Not a fan of Ruby, but the things they outline here are pretty good for testing just about any language.

      I maintain a fork of llvm and a JIT runtime written in Rust where we’ve employed some of these same techniques. E.g. caching llvm builds, running things in parallel…

      Any sufficiently complex, well tested, system has the potential for long CI times. It’s not something unique to Ruby or dynamic languages.

    • AlecSadler@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      arrow-down
      2
      ·
      8 months ago

      I worked for a company that required 95% code coverage but simultaneously complained about how slow tests ran.

      🤷‍♂️

        • AlecSadler@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          8 months ago

          When you have 1000+ Cypress tests, for example, it takes time to run, plain and simple.

          Now, if they were simple unit tests, sure, one could run thousands in a second or two, but they aren’t. Even headless, these just took time.

          • lysdexic@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            8 months ago

            When you have 1000+ Cypress tests, for example, it takes time to run, plain and simple.

            It’s one thing to claim that tests need time to run.

            It’s an entirely different thing to claim that the time it takes to run tests is proportional to test coverage.

            More often than not, you have massively expensive and naive test fixtures in place that act as performance boat anchors and are massive bottlenecks. Thousands of tests run instantly if each test takes around a few milliseconds to run. For perspective, the round trip of network request that crosses the world is around a couple of hundreds of milliseconds. A thousand of sequential requests takes only a couple of minutes. If each of your tests takes that long to run, your tests are fundamentally broken.