Code Monkey home page Code Monkey logo

Comments (6)

ArturT avatar ArturT commented on May 20, 2024

Here is example: https://github.com/ArturT/knapsack#how-to-run-tests-for-particular-ci-node-in-your-development-environment

Could you share more info about your project context. What CI provider do you use? How long is your test suite? RSpec or something else? Why do you want to run test suite in development across threads? Is it small test suite so it's faster in development than pushing to CI?

If you want to run threads using parallel_tests gem then you can take a look on knapsack_pro examples https://github.com/KnapsackPro/knapsack_pro-ruby#how-to-run-knapsack_pro-with-parallel_tests-gem

from knapsack.

tibbon avatar tibbon commented on May 20, 2024

Thanks for such a fast follow up!

My test suite is a mixture of Minitest (migrating away from) and RSpec. Between the two of them the suite is around 4-5 minutes to run fully, but if I could get that down to under a minute it would be great.

We use CircleCI, which is great. It's only building on pull requests right now, and I probably could just push to a work in progress branch more. Between building a VM and everything it's 5-8 minutes on Circle to complete.

I'll check out those examples

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

Regarding idea how to lower down the time of builds on CircleCI you could do this:

  1. Use CircleCI 2.0 which is faster. If you need something specific for your project then you can use custom Docker image. Other than that you can use default Docker images provided by CircleCI. I wrote article with an example how to configure CircleCI 2.0 with ruby + capybara
    http://docs.knapsackpro.com/2017/circleci-2-0-capybara-feature-specs-selenium-webdriver-with-chrome-headless

  2. You have at the moment 2 different test runners minitest and RSpec and below setup is something I recommended for a few companies. You can always get optimal test suite split (the fastest time execution of your tests) by doing:

Step 1: run your minitest test suite with bundle exec rake knapsack_pro:minitest
Step 2: run your RSpec test suite with dynamic RSpec allocation across CI nodes (it's called knapsack_pro Queue Mode) bundle exec rake knapsack_pro:queue:rspec. Thanks to that the dynamic RSpec tests allocation will fill timing gaps across CI nodes so your whole build will have optimal time no matter if your tests have random time execution due to some long-running features specs or external requests in tests. No matter the CI nodes random performance.

You can take a look how dynamic RSpec allocation works with knapsack_pro Queue Mode, here is video at https://knapsackpro.com/

And here is explanation how to configure the proper order of knapsack_pro commands: https://github.com/KnapsackPro/knapsack_pro-ruby#what-is-optimal-order-of-test-commands

If you just want to take a look at knapsack_pro configuration options please see:
http://docs.knapsackpro.com/knapsack_pro-ruby/guide/

Let me know if I could help more :)

from knapsack.

adis-io avatar adis-io commented on May 20, 2024

I don't know, may be somebody already asked about it.
Here is the question, my whole test suit takes huge amount of time. But with parallel_tests (6 cores) it takes about - 30 min. Can I use parallel_tests to generate report?

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

@adis-io Here is an example how to run knapsack_pro with parallel_tests gem https://github.com/KnapsackPro/knapsack_pro-ruby#how-to-run-knapsack_pro-with-parallel_tests-gem

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

I added one more example of how to use paralell_tests with knapsack_pro Queue Mode to utilize machine resource on a single CI machine.

https://github.com/KnapsackPro/knapsack_pro-ruby#parallel_tests-with-knapsack_pro-on-single-ci-machine

There are bash scripts that can be reused.

from knapsack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.