Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "fixtures"
-
Building my own accounting software because everything else is overly complicated and is trying to compete with enterprise accounting tools. All I want is some budgeting, some bill tracking, and categorization.
Writing in Ruby because I'm a masochist. Using built-in minitest because again 😈.
I have currently around 62 assertions. As soon as I add ANY new test that's literally asserting true, everything comes unglued and 20+ failures pop up. Take it out, 62 passes.
I feel like I'm going crazy at this point. The errors also don't make ANY sense. Shit like, "that record doesn't exist" when it's clearly a part of fixtures and is only used in ONE test(the one that's breaking).
Installed minitest bisect, and it's like 🤷♀️"lol get fucked bro!"
So I came here to rant about this before my battery dies and I go drink myself to sleep.
Thank you for coming to my dev-talk.8 -
Don't reuse your fixtures!
Each test case should be isolated. Don't ever think just because some function requires a similar input, it's safe to reuse it ALL OVER THE PLACE.
Why? Because someday, you want to change one functionality of one unit.
And you adapt your tests, fix your code, and suddenly, by changing one fixture, you break dozens if not hundreds of unrelated tests and now you have to clean up that mess.
It's even worse for functional tests with all those interwoven parts so that it becomes hard to reason about the scope of your tests when lacking proper documentation.
How I know? BECAUSE I AM CLEANING UP YOUR MESS RIGHT NOW!3 -
So one of my employees pointed it local setup on the live database to test some weird behavior in an algorithm. Then he starte the next task and wiped his database to reload the fixtures. After that he realized, that he still had the live database credentials in his configuration file.1
-
I don't think I've been more excited about anything than my very first application.
This was when I was just starting out with programming. I had chosen C++ as my first programming language.
A friend and I'd written a simple application to fetch XML data from a sports data server, parse it and display our favourite football (soccer, for Americans) team's fixtures and results on a GUI.
We called it Sportify. -
We need a list of functions with an associated string, keyed by a sequential int. Neither can change between program versions. In fact, any changes align perfectly to program versions.
The datastructure: a list of string and func with statically known parameters
The solution my PO insists on: a class with static methods that have an attribute for specifying the number, and a database table of number to string. Whenever you need to pass around the list, you pass around a Type object of the class.6 -
I'm using typescript and run mocha acceptance tests. I was confused as to why my tests were failing on the Jenkins albeit they passed locally just fine.
I couldn't find the error. Just after making a pause, implementing something else, I realized what the problem was:
As I renamed a folder from `fixtures` to `tapes` my test run on the Jenkins suddenly claimed to not find the files in `fixtures`. Yet in my code base there was no occurrence of the string `fixtures` anymore and then it hit me like a brick wall:
I have old transpiled files in my outDir, the `dist` folder on the jenkins! Locally, I make sure to run `git clean -fd` once in a while, so I never was hit by it it locally. Yet my jenkins had really old files in the `dist` folder. And just running `rm dist/* && tsc` fixed the entire ordeal.
Well, JavaScript is so 2012 and typescript is the new shit, yet transpiling the code can leave to some quite strong headaches.1 -
Hunter Kitchen & Bath, LLC
We are a boutique renovation firm that will custom design your kitchen, bath, library, outdoor kitchen or other home project. Come to our brand-new showroom in Bryn Mawr to select from cabinetry, countertops, tile, wood, hardware, & plumbing fixtures.
Address: 1042 W Lancaster Ave, Bryn Mawr, PA 19010
Phone: (484) 872-8801
Work Hours: Mon-Fri: 9:30AM-4:30PM-Sat:10AM-2PMrant kitchen remodeling bathroom remodeling kitchen desinger kitchen cabinet contractors bath remodeling