Comments (6)
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.
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.
Regarding idea how to lower down the time of builds on CircleCI you could do this:
-
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 -
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.
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.
@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.
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.
There are bash scripts that can be reused.
from knapsack.
Related Issues (20)
- .rspec config looks ignored even in Regular Mode HOT 2
- Knapsack::Adapters::RSpecAdapter does not track time spent in `before` or `after` `:context` HOT 3
- Time execution for pending test file can't be measured due to exception HOT 1
- Cucumber split by scenario and not feature HOT 1
- how often to update knapsack_minitest_report.json timings report HOT 4
- knapsack is skipping some rspecs HOT 3
- Segmentation error under ruby 2.5.0 HOT 2
- How can this be used with the Kubernetes Jenkins Plugin that dynamically creates Jenkins slaves HOT 1
- `uninitialized constant ActiveSupport` with Minitest runner HOT 3
- send complete test coverage report from circleCI building specs to codeclimate HOT 3
- Knapsack does handle signals
- Generate report on minitest HOT 7
- All tests run when no spec files are found HOT 3
- cucumber runner exits with non-zero code even though tests passed HOT 12
- Some cucumber test files run via several CI jobs HOT 5
- Knapsack not generating report for rspec HOT 4
- Knapsack report not found by one job on GitLab CI HOT 5
- Hide Knapsack Time Offset Warning block? HOT 1
- Feature Request: Prioritise spec files HOT 1
- Load Balancing Algorithm doesn't consider weight of nodes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knapsack.