TiL: Doing multiple replacements with gsub in Ruby
gsub is great. It lets you replace characters in a string. All you have to do is give it a regex that will match whatever it is you want to replace and the string that you’d like to replace each match with. For example, if you wanted to replace the time of 18:00 with something a bit more human-readable, you could do the following: 'As always, tea time is at 18:00....
Non-Blocking Ruby Methods
There are lot of options for concurrency in Ruby, from spawning child processes to using threads, ractors and Async. Each have their merits and drawbacks, but one of the simplest and most effective ways to run code concurrently is to use Fibers. In my use-case, I want to do some work and, in the background, perform some network requests. Network I/O is blocking, so I want to make sure I’m doing productive work on the main thread while I wait for the network requests to complete....
TiL: Adding numerous tags to ParallelTests in cucumber elegantly
Trying to run tests in parallel in your CI/CD pipeline is tricky at the best of times, but what if you have tests which should only be run in a certain environment and not as part of the CI build stage? It is fairly simple to just tag a feature file with a unique tag that can then be passed to the bundle exec rake command in the functional-tests step, as an environment variable....
How AWS Step Functions helped streamline the DVLA's application process
Introduction Harnessing the power of AWS Step Functions, the Driver and Vehicle Licensing Agency (DVLA) embarks on a transformative journey to streamline its operations. With over 50 million registered drivers and 40 million vehicles, the DVLA navigates various applications, from driving licences to vehicle registrations. This blog unveils the approach adopted by DVLA to transform its application process, ensuring flexibility and customisation for each application type. Background As the custodian of millions of driver and vehicle records, DVLA grapples with the complexity of managing diverse applications....
TiL: Save CPU cycles by logging blocks
We log a lot in our functional tests. In fact, we log so much we wrote our own logger called Herodotus that extends the default Ruby logger so we can have a correlation id added to the log to help keep track of which scenario a given log is from1. But with that much logging, we want to keep things lightweight. That’s where we want to make sure our logs aren’t doing more work than we expect....