vcr
Parallel Tests
Our great sponsors
vcr | Parallel Tests | |
---|---|---|
20 | 6 | |
5,751 | 3,339 | |
0.5% | - | |
6.4 | 7.1 | |
about 1 month ago | 22 days ago | |
Ruby | Ruby | |
Hippocratic License 2.1 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
vcr
-
Creating integration tests for a backend legacy codebase
Basically, it's a record/replay tool, similar to VCR for Ruby, but on steroids and powered by AI (khm GPT khm).
-
I isolated the entire codebase from external data sources and made a generator of automated tests
I don't think it's right to say "pythagora generates integration tests". It's more of a "replay manual tests as fixtured unit tests," which makes it similar to (but more powerful than) VCR for Ruby HTTP. What I've always wanted for these kinds of "request recorders" is a way to re-validate the test fixtures over time.
-
Write SDK “base” in Rust, wrap in other languages?
For example, they might expect to be able to mock calls to your API with something like VCR or Responses.
-
How to unit test your database interactions with Docker
I also started from the same starting point but then discovered and started using VCR for creating http stubs - https://github.com/vcr/vcr. It allowed me to write against more realistic and complex test scenarios but didn't support databases.
-
When to mock and what to mock in a Web API?
If you had bit more complex workflows or less time - you could start using a VCR library to mock out API interactions and then continue with your dockerised DBs.
-
Ask HN: When an API is down, what do you usually do?
I generally will use vcr[0] or something similar to record requests and then I write tests and code against that.
3rd parties go down, it happens. In general a system that is dependent on a third party should have some non exceptional behavior when that happens.
So if I’m not setup with vcr, and 3rd party is down- I would on the behavior for what happens when it’s down.
[0] https://github.com/vcr/vcr
-
Are there any testing frameworks to intercept HTTP and Database calls?
With external APIs, you can also make use of a gem like VCR. I prefer mocks (plus unit tests around the actual deserialization of the response) to VCR in most cases, but the end result is about the same.
-
Configure VCR with RSpec
A way to avoid this is using the VCR gem.
-
Testing Dependencies: Fake It While You Make It
We'll use a tool called vcr to capture real HTTP requests and responses, storing and using them from then on. VCR's language and terminology leans heavily into its real-world analogue. If you don't know what a VCR is, it's a box we used to hook up to TVs to watch movies before DVD players. If you don't know what a DVD player is, it's a box we used to hook up to TVs to watch movies before streaming.
-
New grad job as Quality Engineer and seeing only negativity about it
[1] https://github.com/vcr/vcr
Parallel Tests
-
Seeking help with moving a locally running, short-lived Docker container to CI / deployment process?
Thanks for that feedback. For some more context, the container is designed to run 40+ processes in parallel sending remote instructions to AWS Device Farm for testing, so I suspect that the RAM usage is expected in this case. If you have any recommendations on re-architecting the execution here I'm all ears.
- working with factory bot and active storage
- How to improve a test suit made with Rspec, Capybara, FactoryBot and Siteprism
-
Who's using Rails 7 test
I know changing from RSpec to MiniTest requires some changes on how you organize the tests and how you think about writing them, but I found that I like MiniTest better after using it for more time, I think it goes straight to the point and it's better integrated (don't quote me on this, but I think minitest handles parallel tests better than RSpec in Rails app because that feature was added with mini test in mind, you would need to add an extra gem for rspec for that https://github.com/grosser/parallel_tests)
-
How We Sped up Our CI Pipeline by Over 4x
Several members of our team worked together to get the parallel_tests gem working for our codebase. Most of our tests were fine running in parallel, but we found enough that made assumptions about the order they would be run in that we had to do some fixing and rewriting. We kept this work in a feature branch, and kept chipping away at it until all the tests would pass.
-
The Perils of Parallel Testing in Ruby on Rails
Let's get one thing out of the way. If you use RSpec rather than Minitest, you are out of luck. RSpec does not support Rails 6 built-in parallel testing. There is an ongoing discussion about changing that, but there hasn't been any significant progress for a while. If you want parallel tests with RSpec, your best bet is still using third-party gems such as grosser/parallel_tests.
What are some alternatives?
Knapsack - Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time.
Spring - Rails application preloader
timecop - A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
Ruby-JMeter - A Ruby based DSL for building JMeter test plans
httparty - :tada: Makes http fun again!
mutant - Automated code reviews via mutation testing - semantic code coverage.
Zapata - An Automatic Automated Test Writer