Regarding the ListenBrainz stats update, did this already happen? Because now, for me and a few others that I checked, the stats for June are missing all listens except for the first day and yesterday (22nd).
Another question, I still have the moviebrainz.org Matrix channels in my Element, those are unused now and I can just leave them, right?
yvanzo: bitmap hi, I tested tests in rust and this is something I came up with. Can you check is I am heading in the right direction with tests, or should I write tests differently?... (full message at <https://matrix.chatbrainz.org/_matrix/media/v3/...>)
* yvanzo: bitmap hi, I tested tests in rust and this is something I came up with. Can you check if I am heading in the right direction with tests, or should I write tests differently?... (full message at <https://matrix.chatbrainz.org/_matrix/media/v3/...>)
zerodogg has quit
zerodogg joined the channel
bitmap[m]
yellowhatpro: sorry if I'm missing something (need coffee), but it doesn't look like you're testing the project at all, just checking that you can query postgres
you should either run the entire service from its entrypoint or at least invoke the poller/archival functions directly
yellowhatpro[m]
bitmap: I am a bit confused regarding what we consider db tests, and unit tests.
So, for example, if I consider writing tests for CRUD ops, will that be considered simply db tests, or unit tests, or even a test?
But thanks, I will test the logic rather than the queries ✅
unit tests typically just test a single isolated function
don't worry about the terminology for the type of tests you're writing, just worry about what you're testing
the entire program would fail already if you couldn't perform basic CRUD ops, so testing that is redundant
yellowhatpro[m]
right, that does seem so.
So, when it comes to tests, should I focus on the corner cases?
For example, I insert the rows in the test db, with say a couple of fields empty, and then test the crud ops ?
Basically, CRUD with corner cases
rimskii[m] has quit
I think I fixated on db test a bit too much. I'll try thinking with a diff perspective.
Thanksss!
bitmap[m]
Yes, I think you may have missed my point, you shouldn't be testing CRUD ops at all
yellowhatpro[m]
Yupp got it now
bitmap: one last question, if I have created a postgres function, then to test it, should I test it with some data and corner cases, right?
bitmap[m]
so, ideally: insert some test edits, edit notes, annotations, etc., and invoke the service (or an isolated part of the service you're testing), then check that it does what it's supposed to
yellowhatpro[m]
or should I test the function which actually calls it
bitmap[m]
e.g., if you have mocks set up for the IA, check that it makes the correct requests to the IA, and that the task state is updated in the DB correctly, etc.
you can test the postgres function indirectly by testing the part of the service that uses it
if you wanted complete test coverage, MBS for example uses pgtap to test postgres functions in an isolated way, but I wouldn't worry about that here
yellowhatpro[m]
cool. got all the pieces I needed.
I actually was considering tests to be testing small isolated blocks, but I didn't really get what do we mean by those small isolated blocks. So I tested queries thinking those to be smallest isolated parts
thanks! Will update soon with actual tests (I hope)
bitmap[m]
if you have small utility functions you've written, then writing unit tests for those is also useful
sqlx crate actually creates a test isolated db for every test function we create
But we don't have any relations in that, so for that I needed fixtures.
We can also insert them inside the test functions as well, but I thought that would be repetitive
bitmap[m]
ah, so those are generated automatically? cool
yellowhatpro[m]
yupp
reosarevok[m]
yvanzo, bitmap : I just realized that we were adjusting strings for event art types and whatnot so that people could translate them... but we only show it to admins anyway now until we merge https://github.com/metabrainz/musicbrainz-serve... so it won't make much of a difference rn
Toasty joined the channel
bitmap[m]
reosarevok: yeah, I thought we were primarily updating them for the wiki page...though that PR would be nice, since it could replace the wiki page (and be translated)
reosarevok[m]
That's kind of the hope
minimal joined the channel
monkey[m] has quit
akshaaatt[m] joined the channel
akshaaatt[m]
pranav: theflash can you please get your PRs reviewed from me? We need to get on pace with things
mayhem[m] has quit
zerodogg has quit
rgggn has quit
rgggn joined the channel
zerodogg joined the channel
atj[m] has quit
zas[m] has quit
aerozol[m]
lucifer: What’s our status re. the stats situation? Got a question on the socials about it
aerozol[m] uploaded an image: (75KiB) < https://matrix.chatbrainz.org/_matrix/media/v3/download/matrix.org/SHVovPucgwJHUxJJdVtQvPcb/image.png >
I see someone in the forums says it’s been fixed? I’m working and don’t have time to check sorry!
zerodogg has quit
zerodogg joined the channel
minimal has quit
Kladky has quit
Maxr1998[m]
<aerozol[m]> "I see someone in the forums says..." <- At least for me it has been fixed, stats are good again.
<Maxr1998[m]> "Another question, I still have..." <- Any comment on this question? Didn't see a reply so I'd like to bump 😅
(for IRC/Discord: it's my question about the old Matrix channels)