Closed MassCraxx closed 1 year ago
I'll have to test this one out since there are a lot of additions to parsing rules being made. Looks great, though.
Yes, we should test this thoroughly, I keep finding border cases.... Did you know its not possible to post a NM achievement if you have the according HC one already? So a lot of ppl post "LFM icc10nm [Heroic: etc]" ... which would currently be seen as icc10hc, but I may have found a solution for this now
If you have a Lua notepad addon or something of the sort, you can run the lfm_tests.lua file. The idea is to have at least some degree of unit testing involved in development, especially because of the indeterministic way in which parsing is done and the potential for edge cases.
I've noticed the difficulty vs. achievement discrepancy in the past before. There's a unit test case that covers something similar.
There are 25 extra failed unit test cases, so I'll have to look into this a little more. I'd like to avoid any regressions if possible.
I use Visual Studio Code, I'm sure its possible to integrate a lua runner somehow, but I did not put time into this as of yet... So I will just call your tests from in game ^^. Its really awesome that you have these tests! I would have never found all the problematic cases otherwise. I already had a quick look on fixing these cases and will come back to you once the failed tests are minimal. This may however lead to even more and more in-depth changes...
Yeah I figured it would be sort of impossible to ensure some degree of correctness from release to release. I was thinking the same sort of thing in terms of running the tests in vitro. Ideally, we just need a few things to mock the covered WoW API calls, but this might be more work than it seems. Good to hear though!
Ok, sorry for the upranking complexity of changes, but I got it down to 4 failed test cases, and I think these remaining ones are questionable:
Original message: lf icc 10 group
Imo without context that could also mean he is looking for people for his group.Original message: lf icc10 5.5k rogue
Same here, if this wouldnt be sent by a rogue, it could easily mean a lead is looking for a good rogueOriginal message: NEW RUN [Sartharion Must Die!] 25er w me info !!
This I would also not be sure if the sender is looking or offeringLFM ICC10 full nm glory run NEED 1Rsham 1FDK 1SP 6.3k+ must have time and brain [Bane of the Fallen King] (discord required)
Test failed: detected list of roles is not correct - this would be easily fixable by adding 'FDK'..sep to the tank patterns, but I would not be sure myself if the lead actually expects a tankI think the changes are quite solid, but I am not sure if the finding process can be simplified: for my current approach I first look for the pattern index before replacing the pattern with the meta placeholder (core.lua L1012+1015) I was thinking maybe both can be done in one action? Let me know what you think.
I like the idea about putting weekly quests into their own parsing raid category. I also like the new debugging functionality.
Yeah those test cases (aside from the last one) are questionable and can probably be removed. Ideally, it would be nice to try to classify the current test cases to discover new classes of test cases to consider. I think I might look into creating a test environment so that we could see code coverage, and in particular, lfm pattern coverage. We could also probably quickly do this manually, so I might just do that instead for now lol.
I've been testing the changes and everything seems to be working well. I indeed get a 4/198 failed (pretty much 1/198) rate as you said, which is great!
I noticed only some of the often posted weekly quests and achievements are being parsed, so I put some work into improving this.
These changes will also support localized clients, since both, english quest/achievement title and actual ID in links are compared. While working on this I also noticed that LF5M or alike are not being processed, so that is fixed as well.
improve parsing weekly quest raid messages, add new category for weekly quest raids (wq), improve parsing achievement quest raid messages, improve parsing lfm (including LF5M etc), add some missing dps patterns