-
Notifications
You must be signed in to change notification settings - Fork 95
Expand mass_create_tool's capabilities #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… (fixes …" (sio2project#598) This reverts commit 0c1da0e.
This commit allows for creating and populating (with users & problems) contests, using the mass_create_tool management command. Two new arguments are added: --createcontest (-cc) to enable contest creation, and --contestname (-cn) to specify the contest's name.
Previously, the mass_create_tool only created empty problems.
This commit changes that by adding a list of problem_packages (-pp)
as an option to the tool. The tool searches the oioioi/sinolpack/files/ directory
for the specified problem packages and uploads them to the created contest.
Example command enabled by this commit:
python3 manage.py mass_create_tool -cn=quite_useful_contest -cc -pp=test_full_package.tgz -u=10 --wipe
^ (This will create a contest named 'quite_useful_contest' with 10 users,
and upload 'test_full_package.tgz' to a new round in that contest.)
Previously the mass_create_tool could only be used for creating uers, problems and contests. This commit makes it possible to automatically generate code submissions on behalf of users.
150bfe9 to
cbfd117
Compare
This commit also removes the unnecessary line change in admin.py - it was experimental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request expands the mass_create_tool management command to create contests populated with automatically generated submissions, enabling more comprehensive testing and benchmarking scenarios.
Key Changes:
- Added contest creation functionality with automatic user registration and submission generation
- Introduced support for creating problems from package files
- Extended the wipe functionality to clean up generated contests and submissions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
oioioi/problems/tests/test_commands.py |
Added test cases for contest creation with problem packages, users, and submissions; updated assertion logic to handle submissions from auto-generated users |
oioioi/problems/management/commands/mass_create_tool.py |
Implemented contest creation with problem instances, user registration, and submission generation; added methods for package-based problem creation and submission file handling; extended cleanup to remove generated contests and submissions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Unit tests were added, and the PR is now ready for review. This PR expands the mass_create_tool's capabilities, by enabling creating a contest and populating it with submissions from auto generated users. This should make testing new features easier for developers. E.G. Commands for the mass_create_tool can be called through |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
This PR expands the mass_create_tool's capabilities, by enabling creating a contest and populating it with submissions from auto generated users. This should make testing new features easier for developers.
E.G.
mass_create_tool -cn demo -cc -pp test_full_package.tgz -u 10 -sf sum-correct.cpp sum-various-results.cpp -spu 3 --wipe
This command wipes all other mass generated data, creates a contest called "demo" and adds 10 users to it, with 3 submissions (drawn randomly out of [ sum-correct.cpp, sum-various-results.cpp]) to the example problem each.
Commands for the mass_create_tool can be called through manage.py.
Closes #603