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).
2024-06-23 17548, 2024
Maxr1998[m]
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/download/chatbrainz.org/fSLEeRolsJqcUvvGzYHxtrpD>)
2024-06-23 17551, 2024
yellowhatpro[m]
* 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/download/chatbrainz.org/SHAwfcckjXwIZvgSbtgRPGXz>)
2024-06-23 17504, 2024
zerodogg has quit
2024-06-23 17546, 2024
zerodogg joined the channel
2024-06-23 17547, 2024
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
2024-06-23 17550, 2024
bitmap[m]
you should either run the entire service from its entrypoint or at least invoke the poller/archival functions directly
2024-06-23 17501, 2024
yellowhatpro[m]
bitmap: I am a bit confused regarding what we consider db tests, and unit tests.
2024-06-23 17501, 2024
yellowhatpro[m]
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?
2024-06-23 17543, 2024
yellowhatpro[m]
But thanks, I will test the logic rather than the queries ✅
2024-06-23 17506, 2024
yellowhatpro[m]
Also, I tried testing the postgres function which I created for polling the edit_note and edit_data tables,... (full message at <https://matrix.chatbrainz.org/_matrix/media/v3/download/chatbrainz.org/jbBIKAUCagWYnuyNPfFMiZik>)
2024-06-23 17559, 2024
bitmap[m]
unit tests typically just test a single isolated function
2024-06-23 17519, 2024
bitmap[m]
don't worry about the terminology for the type of tests you're writing, just worry about what you're testing
2024-06-23 17541, 2024
bitmap[m]
the entire program would fail already if you couldn't perform basic CRUD ops, so testing that is redundant
2024-06-23 17512, 2024
yellowhatpro[m]
right, that does seem so.
2024-06-23 17512, 2024
yellowhatpro[m]
So, when it comes to tests, should I focus on the corner cases?
2024-06-23 17549, 2024
yellowhatpro[m]
For example, I insert the rows in the test db, with say a couple of fields empty, and then test the crud ops ?
2024-06-23 17549, 2024
yellowhatpro[m]
Basically, CRUD with corner cases
2024-06-23 17532, 2024
rimskii[m] has quit
2024-06-23 17536, 2024
yellowhatpro[m]
I think I fixated on db test a bit too much. I'll try thinking with a diff perspective.
2024-06-23 17536, 2024
yellowhatpro[m]
Thanksss!
2024-06-23 17520, 2024
bitmap[m]
Yes, I think you may have missed my point, you shouldn't be testing CRUD ops at all
2024-06-23 17538, 2024
yellowhatpro[m]
Yupp got it now
2024-06-23 17545, 2024
yellowhatpro[m]
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?
2024-06-23 17557, 2024
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
2024-06-23 17502, 2024
yellowhatpro[m]
or should I test the function which actually calls it
2024-06-23 17527, 2024
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.
2024-06-23 17524, 2024
bitmap[m]
you can test the postgres function indirectly by testing the part of the service that uses it
2024-06-23 17539, 2024
bitmap[m]
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
2024-06-23 17544, 2024
yellowhatpro[m]
cool. got all the pieces I needed.
2024-06-23 17544, 2024
yellowhatpro[m]
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
2024-06-23 17553, 2024
yellowhatpro[m]
thanks! Will update soon with actual tests (I hope)
2024-06-23 17529, 2024
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
2024-06-23 17517, 2024
yellowhatpro[m]
But we don't have any relations in that, so for that I needed fixtures.
2024-06-23 17517, 2024
yellowhatpro[m]
We can also insert them inside the test functions as well, but I thought that would be repetitive
2024-06-23 17539, 2024
bitmap[m]
ah, so those are generated automatically? cool
2024-06-23 17512, 2024
yellowhatpro[m]
yupp
2024-06-23 17510, 2024
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-server/… so it won't make much of a difference rn
2024-06-23 17549, 2024
Toasty joined the channel
2024-06-23 17526, 2024
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)
2024-06-23 17553, 2024
reosarevok[m]
That's kind of the hope
2024-06-23 17514, 2024
minimal joined the channel
2024-06-23 17557, 2024
monkey[m] has quit
2024-06-23 17516, 2024
akshaaatt[m] joined the channel
2024-06-23 17516, 2024
akshaaatt[m]
pranav: theflash can you please get your PRs reviewed from me? We need to get on pace with things
2024-06-23 17557, 2024
mayhem[m] has quit
2024-06-23 17535, 2024
zerodogg has quit
2024-06-23 17544, 2024
rgggn has quit
2024-06-23 17524, 2024
rgggn joined the channel
2024-06-23 17545, 2024
zerodogg joined the channel
2024-06-23 17532, 2024
atj[m] has quit
2024-06-23 17552, 2024
zas[m] has quit
2024-06-23 17503, 2024
aerozol[m]
lucifer: What’s our status re. the stats situation? Got a question on the socials about it
2024-06-23 17506, 2024
aerozol[m] uploaded an image: (75KiB) < https://matrix.chatbrainz.org/_matrix/media/v3/download/matrix.org/SHVovPucgwJHUxJJdVtQvPcb/image.png >
2024-06-23 17557, 2024
aerozol[m]
I see someone in the forums says it’s been fixed? I’m working and don’t have time to check sorry!
2024-06-23 17513, 2024
zerodogg has quit
2024-06-23 17535, 2024
zerodogg joined the channel
2024-06-23 17547, 2024
minimal has quit
2024-06-23 17527, 2024
Kladky has quit
2024-06-23 17513, 2024
Maxr1998[m]
<aerozol[m]> "I see someone in the forums says..." <- At least for me it has been fixed, stats are good again.
2024-06-23 17540, 2024
Maxr1998[m]
<Maxr1998[m]> "Another question, I still have..." <- Any comment on this question? Didn't see a reply so I'd like to bump 😅
2024-06-23 17514, 2024
Maxr1998[m]
(for IRC/Discord: it's my question about the old Matrix channels)