[01:12:23] It is weird popping in occassionally to see Reedy talking to a bot... [01:33:35] [telegram] Would be worse if there was no bot, but he would still talking to someone :) [11:13:38] [telegram] Any Lua/Scribunto experts here? I find it so frustrating to test module code without being able to use frame properly. https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#frame-object for frame is…lacking to say the least. [11:13:38] [telegram] The documentation for frame object says [blablabla] "A frame object is typically obtained by being passed as a parameter to the function called by {{#invoke:}}, and can also be obtained from mw.getCurrentFrame()." [11:13:40] [telegram] While the documentation for mw.getCurrentFrame() says "Returns the current frame object, typically the frame object from the most recent #invoke." [11:14:18] [telegram] That's a circular reference if I ever saw one. So what the hell is a frame object exactly, and how can I emulate one while testing module code, without doing dozens of save/purge & repeat? [11:20:40] [telegram] I do not have an answer to your question, but I want to remind that you can also preview other pages with the module/template you are editing, that field where you put page name at the bottom. No need to save dozens of times this way. [11:21:50] [telegram] What @Thecladis says. What I do is I create a page with tests for the template or a module in my user space or as a subpage of the template, and I use this preview function to see whether it doesn't break something. [11:22:59] [telegram] Like this one, which I made when I was migrating some wikitext templates to Lua: https://en.wikisource.org/wiki/User:Amire80/test-transclude [11:23:31] [telegram] If anyone knows a better way, please tell me. I wish there was a more structured framework for testing templates and modules. [11:24:39] [telegram] I don't know if this will work for my usecase – I'm modifying a module that is only transcluded by other modules – but I'll give it a shot and see if it works [11:25:09] [telegram] thanks [11:25:41] [telegram] low-level unit testing is mostly a good thing :) [11:25:53] [telegram] and high-level integration testing is also a good thing :) [11:26:33] [telegram] /me doesn't know the difference 😝 [11:27:08] [telegram] unit testing = testing that the functions in your internal module, which is only imported by other modules, work as intended. [11:27:49] [telegram] integration testing = testing that the whole package works, so in your case it's testing that the modules that import the module you're modifying still work after the modification. [11:28:45] [telegram] (I actually did software testing training 13 years ago, and I have an ISTQB certificate somewhere at home.) [11:29:47] [telegram] makes sense 👍 thanks for explaining [11:31:30] [telegram] can't you use the test-wiki to test modules? [16:45:30] [telegram] +1, or the beta cluster! But sometimes that means you have to import all other dependent modules and templates first… [17:00:35] [telegram] sure ... but that only needs to be done once I guess [17:02:57] until they're out of date with prod [17:03:20] [telegram] ah, yeah, you're right [17:53:23] [telegram] Most templates and Lua modules have sandbox versions. Before you start you first have to start with a clean sandbox. Same here I guess