And it’s been nine days since we learned 0.19.1 didn’t fix the problem. There’s a lesson to be learned here: don’t push a massive update close to the holidays because, ya know, you might break federation and go on vacation for a week+.
And it’s been nine days since we learned 0.19.1 didn’t fix the problem. There’s a lesson to be learned here: don’t push a massive update close to the holidays because, ya know, you might break federation and go on vacation for a week+.
There is also a lesson in implementing proper tests. During these holidays I started to play a bit more with Rust and went on to look at Lemmy’s backend code. Not a single unit test in sight…
We all await your commit containing all those simple unit tests with bated breath.
I want to work an issue that is open since 2020, but I can only justify dropping all my other work for that if I have enough paying customers interested in some new feature. So, help me get 50 customers to my “all in one” hosting service and I will dedicate a week to it, which should be more than enough time for even a Rust newbie like me to submit a proper PR to that issue. Ok?
There is already an open PR for Oauth, though Im not sure whats the difference to LDAP. Regarding tests you must have looked in the wrong place, we have a couple hundred already. Docs are here.
Unless there is some thing inherent to how Rust runs tests, the test script seems be mostly integration tests exercising the API. There does not seem to be unit tests which would be the first thing you’d need to have to test like the function that seems to be the source of the bug. (Hint, if your test suite needs to have a running db, you are not unit testing.)
As for OAuth vs LDAP: both could be used as part of a Single Sign-On solution, but the actual use cases are completely different. Having LDAP authentication would allow, e.g., to let users authenticate to Lemmy using an intranet account or (in the case of Communick) customers could use the same credentials for their Mastodon or Matrix accounts.
Sounds like you are looking at the api tests then. There are also unit tests which you can run with
./scripts/test.sh
. The database is a fundamental part of Lemmy, so its obviously required for many of the unit tests. It may be possible to mock the db, but that would be a lot of effort for very little benefit, and might even introduce additional bugs.Yeah and plz send 2000€ and I’ll work on it too.
This issue looked interesting to me but I know I simply can’t submit a pr with chatgpt generated code. For a project this big, extensive testing should be done. I don’t know how extensive testing is done in lemmy but if it isn’t proper, they should do it before it becomes a mess.
To be fair, I’ve yet had a job that actually pulls off unit testing. Most either don’t bother or just go for the grunt work bare minimum to force pass tests. Most friends in my field have had pretty much the same experience. Unit tests can be just a chore with little to no real benefit. Maybe an opensource project that actually cares about its code can pull it off, but I wouldn’t bat an eye if they never get to it.
If you go through the comments, you will see that the devs talk about an issue with the logic in the for loop, which “may be stopping before it should”. Writing a couple of test cases that check whether this is true or not should be trivial.
I’d expect at the very least some type of regression tests to be implemented for every bug that makes into production, to avoid cases like this one where the developers spend weeks figuring out whether their patches even fix the bug in the first place.
What kind of job do you have, making websites?
I’m surprised that’s your experience. I’ve worked 4 software engineering jobs now, and every single project has had well done unit test suites.
Same. Every team talks a good game about unit testing but in nearly 20 years I’ve yet to see a single worthwhile test in a company’s code base. I eventually stopped asking about it when doing M&A research.