Unittests for syncthing?

Does they exist unittests for syncthing?

Think this is a must-have to find all bugs and detect new bugs. Test driven is IMHO a good idea.

I can imagine to start some tests in python. Don’t know if this makes sense. It would be IMHO easy to create linux or windows only tests. But a real test environment solution should test a cross platform cluster at once.

That’s what the *_test.go files do (eg this).

But maybe it would also be useful to have “external” tests, for API compliance and such?

My thoughts: A python script that:

It would be helpful, if the is a way to start synching from external.

Yep. The test coverage could always be better, of course. The tests can be run by go test ./... or (for the correct dependencies) as ./build.sh test.

This is an integration test. There are currently two, one general which does approximately what you describe above, and one more specific to test syncing of folder attributes. You’ll find these in the integration folder, as test.sh and folders.sh. If syncthing is in your path and you’re running on Linux or Mac you should be able to run these scripts as ./test.sh and observe the results. They take quite a while to run and use a few gigs of disk space.

If you want to contribute more tests (Python is fine), please do! :slight_smile:

I would like to see tests. I think it’s the only way to catch all bugs.

I start https://github.com/jedie/syncthing-pytest (currently empty)