From cc99dc6778d2612227d397c2a4dd40f0f470741f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kwieci=C5=84ski?= Date: Wed, 21 Jan 2026 14:48:23 +0100 Subject: [PATCH 1/2] Add mock data creation to easy_toolbox --- README.rst | 13 +++++++++++++ easy_toolbox.py | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.rst b/README.rst index c5d7ffa40..cccfe6c14 100644 --- a/README.rst +++ b/README.rst @@ -131,6 +131,19 @@ If you want to check all files, not just the modified ones, you can run:: pre-commit run --all-files +Creating mock data (for development) +~~~~~~~~~~~~~~~~~~~~~~~ + +To quickly populate your development environment with sample data, you can use the following commands:: + + ./easy_toolbox.py populate-sample-data + +This creates a contest with a sample problem package and 10 users, each with 3 submissions. + +To remove all the data created by the above command (and any data created by the mass_create_tool):: + + ./easy_toolbox.py wipe-sample-data + Manual installation (deprecated) ~~~~~~~~~~~~~~~~~~~ diff --git a/easy_toolbox.py b/easy_toolbox.py index de5b102c7..733d39fbe 100755 --- a/easy_toolbox.py +++ b/easy_toolbox.py @@ -74,6 +74,17 @@ "Run Ruff, a linter and formatter. You can add `--fix` to automatically fix some errors.", "{exec} -w /sio2/oioioi web bash -c 'ruff check . {extra_args} ; echo ; ruff format .'", ), + ( + "populate-sample-data", + "Creates a contest with the sample problem package and 10 users, with 3 submissions each.", + "{exec} web python manage.py mass_create_tool -cn demo -cc -pp test_full_package.tgz -u 10 -sf sum-correct.cpp sum-various-results.cpp -spu 3 -v 0", + ), + ( + "wipe-sample-data", + "Wipes all contests, problems, users and submissions created with `populate-sample-data`.", + "{exec} web python manage.py mass_create_tool --wipe", + "Warning: This will wipe all data created using the mass_create_tool. Are you sure you want to proceed?" + ) ] longest_command_arg = max([len(command[0]) for command in RAW_COMMANDS]) From dfd3ccd25bd78305ef9f10b3e12724cbd7e75ad9 Mon Sep 17 00:00:00 2001 From: Jankwi <153385549+Jankwi@users.noreply.github.com> Date: Wed, 21 Jan 2026 16:19:28 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- easy_toolbox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easy_toolbox.py b/easy_toolbox.py index 733d39fbe..60aff3885 100755 --- a/easy_toolbox.py +++ b/easy_toolbox.py @@ -76,12 +76,12 @@ ), ( "populate-sample-data", - "Creates a contest with the sample problem package and 10 users, with 3 submissions each.", + "Create a contest with the sample problem package and 10 users, with 3 submissions each.", "{exec} web python manage.py mass_create_tool -cn demo -cc -pp test_full_package.tgz -u 10 -sf sum-correct.cpp sum-various-results.cpp -spu 3 -v 0", ), ( "wipe-sample-data", - "Wipes all contests, problems, users and submissions created with `populate-sample-data`.", + "Wipe all contests, problems, users and submissions created with `populate-sample-data`.", "{exec} web python manage.py mass_create_tool --wipe", "Warning: This will wipe all data created using the mass_create_tool. Are you sure you want to proceed?" )