Open Donaschmi opened 2 years ago
Useful yes, but probably not as simple as it may seem.
There is no modeling layer in INGInious for now and many checks are done in the app logic. Writing such a tool with the code as is may lead to a lot of duplicate code to perform validity and integrity checks.
Moreover, there historically are two data storages that are still not merged: the MongoDB database and the course data and backup filesystems that have limited but existing relations. The plan at this time is still to put every non-file data in MongoDB and expose the data through filesystem emulation (using the webdav library). That would increase the overall application performance and ease the usage of a modelling layer that will be able to perform basic integrity checks that are currently done in the application logic.
In conclusion, writing such a tool right now or in the (near) future would require at least some refactors in several parts of the code to avoid duplicating a lot of quite sensible code.
It is sometimes necessary to test functionalities that would require manually creating models (courses, students, tasks, ...) and it can quickly become cumbersome.
One solution to this is a database seeder (programmatically or CLI) that can create one or multiple instances of a model and related models.
For example, if I want to create a course with 100 fake students I can specify it when calling the seeder:
(don't mind the parameter syntax, it is just an example)
Let's discuss if you think this would be useful.