RimWorld

RimWorld

RimTest - Automated Testing Framework
33 Comments
LaTrissTitude  [author] May 22, 2024 @ 9:49am 
@Scorpio: No idea ! :D Could still probably work though
Scorpio Aug 5, 2022 @ 9:42am 
how the hell i just discovered this
LaTrissTitude  [author] Oct 21, 2020 @ 4:37am 
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 Oct 21, 2020 @ 3:11am 
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 Oct 20, 2020 @ 5:21pm 
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  [author] Oct 20, 2020 @ 5:12pm 
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 Oct 20, 2020 @ 4:43pm 
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  [author] Oct 20, 2020 @ 10:42am 
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 Oct 20, 2020 @ 8:06am 
What are the odds of getting this as a NuGet package as well?
LaTrissTitude  [author] Oct 20, 2020 @ 6:18am 
Update sent! (check the previews for more info about the new interface!)
LaTrissTitude  [author] Oct 20, 2020 @ 4:37am 
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 Oct 20, 2020 @ 4:20am 
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  [author] Oct 20, 2020 @ 4:13am 
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 Oct 20, 2020 @ 3:55am 
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  [author] Oct 11, 2020 @ 10:56pm 
\o/
JonnyNova Oct 11, 2020 @ 7:19am 
This is great! I was able to use it to track down some persistent and very difficult to find floating point rounding cases
LaTrissTitude  [author] Oct 7, 2020 @ 12:46am 
it is, sporadically though, summer holidays are gone so my focus is currently on my studies
JonnyNova Oct 6, 2020 @ 6:34pm 
Is this still being worked on?
LaTrissTitude  [author] Sep 1, 2020 @ 3:13am 
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 Sep 1, 2020 @ 2:46am 
@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  [author] Sep 1, 2020 @ 1:59am 
New update, with a new test display which reduce the spamming at a strict minimum
LaTrissTitude  [author] Aug 31, 2020 @ 9:09am 
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 Aug 30, 2020 @ 9:22am 
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 Aug 23, 2020 @ 12:30am 
Great work
Yolo$wagger Aug 22, 2020 @ 1:04pm 
Modders are the lifeblood of Rimworld, great job!
Tovias Aug 22, 2020 @ 12:35pm 
Great job
redgiratina01 Aug 20, 2020 @ 3:13pm 
ty ambos, uwu
LaTrissTitude  [author] Aug 17, 2020 @ 5:37pm 
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  [author] Aug 17, 2020 @ 5:33pm 
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 Aug 17, 2020 @ 5:27pm 
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 Aug 17, 2020 @ 5:24pm 
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  [author] Aug 17, 2020 @ 1:50pm 
no hablo español, I'll add some more tutorials in the future though, I hope it'll help
redgiratina01 Aug 17, 2020 @ 1:17pm 
porfavor podrian traducirme como va este mod en español C: o explicarme