RimWorld

RimWorld

RimTest - Automated Testing Framework
33 kommentarer
LaTrissTitude  [ophavsmand] 22. maj 2024 kl. 9:49 
@Scorpio: No idea ! :D Could still probably work though
Scorpio 5. aug. 2022 kl. 9:42 
how the hell i just discovered this
LaTrissTitude  [ophavsmand] 21. okt. 2020 kl. 4:37 
Pausbrak: ah yes I see what you mean, this is on my todo list to be able to automatically set up a context (save / game state) to run specific tests / test suites. For now you have to manually run the suites though.
Right now my goal is to move this GUI from the mod settings into the debug toolbar to allow running tests anytime including pre-game (like during the scenario editor or the character editor)

Strielok: This mod is mainly a bug reporting tool user-wise, the scope of this mod is to be a tool for modders to detect bugs in their C# code, this needs C# coding.
Users shouldn't have to use it unless bugs are detected, in which case the debug log will just automatically appear with a dump of the testing log to share with the mod author by default.
Also it already is perfectly useable with harmony
Striełok 21. okt. 2020 kl. 3:11 
Hey, this stuff is quite good, but i'm see two major problems
1)not user friendly, you need know something about code, i can program in C but in C for microcontrolers, C# is total abstraction for me, and after something about 3 hours i'm just start undersdanding what you want from me, and i'm REALY dont want do this for 500+ mods
2)i think it can be popular for moders, but when you integrate it with harmony, and reduce user-work as much as you can it will be a huge step forward becouse a lot of mods require harmony and autotest feature will be great
Pausbrak 20. okt. 2020 kl. 17:21 
The issue I'm running into is that my tests fail when they run automatically at game startup.
They're failing because they try to create a Thing but there's no map initialized and the Def database isn't populated. It's not a huge problem as I can just load a debug save and rerun them, but I was hoping to avoid needing to do that if possible.

Alternatively, if there was a way to just specify that specific tests should be delayed until a game is loaded, that'd be fine too. Mostly I want to avoid spurious red errors on startup
LaTrissTitude  [ophavsmand] 20. okt. 2020 kl. 17:12 
To provide a full answer I will need more details about your request; however if you're talking about unit testing without needing a running game instance, you probably already can unit test those parts of your mod using the already available full fledged C# testing environments, iirc hugslibs has some of those for example!
Pausbrak 20. okt. 2020 kl. 16:43 
The update is working great so far, and I'm liking the ability to run tests at runtime. As it turns out, that was a feature I'd need next anyway, since my tests don't work without a game instance.

Still, it bothers me a bit that I need a game instance up and running for what should be unit tests. Do you know of a good way to mock up a Thing for a test? Right now I'm replicating the way the debug menu spawns items but that only works when a world is loaded. I can avoid the issue for most of my tests, but I've got some logic involving pulling data from Things depending on what kind of object they are that really needs testing.
LaTrissTitude  [ophavsmand] 20. okt. 2020 kl. 10:42 
low priority as I don't dev in C# outside of rimworld modding for now, however it might be handy for an eventual visual studio integration
Madara Uchiha 20. okt. 2020 kl. 8:06 
What are the odds of getting this as a NuGet package as well?
LaTrissTitude  [ophavsmand] 20. okt. 2020 kl. 6:18 
Update sent! (check the previews for more info about the new interface!)
LaTrissTitude  [ophavsmand] 20. okt. 2020 kl. 4:37 
Update coming right up, I'm just preparing some previews first for the mod page, also huglibs becomes a dependency (it's settings UI is just way too useful)
Pausbrak 20. okt. 2020 kl. 4:20 
Ah man, I just got through playing around with it on my end and came to the same conclusion as that bug report XD. Glad to hear the fix is already implemented!
LaTrissTitude  [ophavsmand] 20. okt. 2020 kl. 4:13 
ah, yes it's a linux bug which has been fixed for the next version: https://github.com/helldragger/RimTest/pull/2

You know what I'll release the current experimental version right now to fix this, however the new UI is not fully ready!
Pausbrak 20. okt. 2020 kl. 3:55 
I'm getting a truly baffling error trying to use this to test a mod of mine. The included self-test suite works fine and outputs as expected. However, the moment I add any test in my own mod (even a simple Assert(true).To.Be.True()), I get a bizarre exception from sorting the list of assemblies:

https://gist.github.com/HugsLibRecordKeeper/bab7d38aa10e2864e6418ff977f4ff5e

Any ideas what might be going on here? I'm almost wondering if this might be a .NET/Mono incompatibility or something (I'm running on Linux).
LaTrissTitude  [ophavsmand] 11. okt. 2020 kl. 22:56 
\o/
JonnyNova 11. okt. 2020 kl. 7:19 
This is great! I was able to use it to track down some persistent and very difficult to find floating point rounding cases
LaTrissTitude  [ophavsmand] 7. okt. 2020 kl. 0:46 
it is, sporadically though, summer holidays are gone so my focus is currently on my studies
JonnyNova 6. okt. 2020 kl. 18:34 
Is this still being worked on?
LaTrissTitude  [ophavsmand] 1. sep. 2020 kl. 3:13 
ah didn't check the github, I pushed the update and rushed to the uni cantina before it was too crowded, gonna check right now
Fluffy 1. sep. 2020 kl. 2:46 
@Helldragger; did you notice I made a pull request on your github? Could you push your most recent changes to GitHub please, so that I can contribute further?
LaTrissTitude  [ophavsmand] 1. sep. 2020 kl. 1:59 
New update, with a new test display which reduce the spamming at a strict minimum
LaTrissTitude  [ophavsmand] 31. aug. 2020 kl. 9:09 
Rather than disabling them, I can reduce the amount of verbosity to the bare minimum aka only displaying skipped and broken tests when needed. I tried to create a GUI in the debug toolbar for it but all my attempts failed miserably... ^^'

For an end user, if a test breaks in their modlist, they can directly report which tests failed to the mod author
Fluffy 30. aug. 2020 kl. 9:22 
could you disable the suite of tests for RimTest itself? It's rather spammy. Besides that, I think I might like this, in the process of trying it on some of my more persistent/complicated bugs/mods.

If I'm honest, I don't see the point of this as a user mod at all though, I'm only referencing it in a local debug build, and can't see a situation where I would make it a release dependency.
NobleMilkMan 23. aug. 2020 kl. 0:30 
Great work
Yolo$wagger 22. aug. 2020 kl. 13:04 
Modders are the lifeblood of Rimworld, great job!
Tovias 22. aug. 2020 kl. 12:35 
Great job
redgiratina01 20. aug. 2020 kl. 15:13 
ty ambos, uwu
LaTrissTitude  [ophavsmand] 17. aug. 2020 kl. 17:37 
The goal here is really to help the modding community to get a more stable, efficient and pleasurable modding experience, it starts by having proper tools in the first place! :D
LaTrissTitude  [ophavsmand] 17. aug. 2020 kl. 17:33 
If used properly, it can absolutely become a really useful tool for bug reporting for non modders. Players will be able to report more precise errors with the test results to complement the habitual stacktraces and error logs, so modders will be able to focus on more precise zones of their mods when errors arise.

However the tool does nothing by itself, modders actually have to test their mods for it to truly shine!
Joko 17. aug. 2020 kl. 17:27 
so, @Helldragger Will this mod be "non-modder" friendly? Like someone with no knowledge at all, can still use/understand it to find what mod is breaking what?

Man if its work like i have on my mind, this mod will change the modding community forever making mods even more compatible than before with minimal error.
Joko 17. aug. 2020 kl. 17:24 
Finalmente una unidad de testeo de los mods de rimworld.

Escribe el texto de como tu mod deveria comportarse > corre el juego > Verifica exactamente que fue lo que fallo > arregla el error > Expande tu mod eficientemente sin tener que textear la misma cosa dos veces!

No necesitaras horas de texteo para encontrar errores en cada chance que tengas, cuando puedes verificar todo en segundos.

Tambien puede ser usado para detectar incompatibilidad de mods y poder arreglarlas, solo sube los mods y chekea que esta roto y como exactamente esta roto.


(En otras palabras, es un mod que ayuda a los moderadores a textear sus mods antes de subirlos al steam, evitandoles desperdiciar muchas horas rtexteando. Tambien puede ser usado para saber que mod es incompatible con que otro mod y cual exactamente es la incompatividad para que lo puedas arreglar)
LaTrissTitude  [ophavsmand] 17. aug. 2020 kl. 13:50 
no hablo español, I'll add some more tutorials in the future though, I hope it'll help
redgiratina01 17. aug. 2020 kl. 13:17 
porfavor podrian traducirme como va este mod en español C: o explicarme