ClementDreptin / OpenNeighborhood

Cross-platform clone of Xbox 360 Neighborhood.
Apache License 2.0
46 stars 4 forks source link

Integration tests wanted? #4

Closed tuxuser closed 2 years ago

tuxuser commented 3 years ago

Hey,

Wondering if you consider integration tests to be beneficial for this project?

Basically mocking a XBDM host to test the library.

Started on an example here: https://github.com/tuxuser/open-neighborhood/tree/tuxuser/tests/skeleton

As you can see, tests are not reliable, but just wanted to check with you first if its considered useful.

cheers

ClementDreptin commented 3 years ago

Hi,

I think integration tests are overall a good practice but probably not in this project, or at least not in this way. We would have to create a fake XBDM server to run the tests remotely, which defeats the purpose of testing interaction with the Xbox 360 in my opinion.

I have some testing experience in other languages but not in C++ and I would like to gain some before integrating tests into this project.

Thank you for submitting nonetheless and for the general interest you're showing to the project !

Cheers

tuxuser commented 3 years ago

I think integration tests are overall a good practice but probably not in this project, or at least not in this way

Yeah, exactly. They are called integration tests technically, cause they create a fake XBDM server, but actually are unit tests heh.

I have some testing experience in other languages but not in C++ and I would like to gain some before integrating tests into this project.

Sure, same for me actually, first time doing tests in C++ as well.

I will let the branch exist, maybe extend it a lil for quickly testing new commands that will be added.

ClementDreptin commented 3 years ago

I might try to integrate tests in the future.

There are still some key futures that need to be implemented like launching an XEX, sending/receiving files, going in the parent directory, etc. so I want to focus on that for now.

GoobyCorp commented 2 years ago

Sorry to resurrect this but I just found out about this repo, I wrote an XBDM emulator years back: xbdm_emulator_async.py config.json jrpc2_config.json

screenshot

ClementDreptin commented 2 years ago

Hi @GoobyCorp,

Thanks for sharing :)

I also wrote a fake XBDM server a long time ago when I wanted to test OpenNeighborhood without my console. It was never part of the repo because it was something I quickly put together with Node.js.

I still plan on making one in C++ and integrate it in the repo to start writing tests and your implementation will definitely help me. Thanks !

GoobyCorp commented 2 years ago

No problem, I just updated that gist with the one I have working with the SENDVFILE command and it now allows for sending multiple files. This implementation actually remaps drives, files, and folders to use a local folder. It also supports JRPC2 commands. I put it together to dump setmem commands from tools that access the console to know if they were stealing my KV or not. All the research on it was from using wireshark dumps from a devkit connected to neighborhood, I've pretty much covered all of neighborhood's functionality in it and more.

ClementDreptin commented 2 years ago

All the research on it was from using wireshark dumps

I pretty much did the same thing but I have an RGH and not a devkit so I was limited to what is implemented in the homebrew XBDM server for the retail kernel (which is not much)

ClementDreptin commented 2 years ago

Little update on the subject !

Due to recent changes in the architecture, XBDM has been moved to a separate repository and integration tests are currently being worked on. I basically took @tuxuser's mocking class and made it compatible with Windows. I'm also not using googletest but a very barebones testing framework I quickly put together.

Thanks again for you contributions !