Skip to content

Commit

Permalink
Pass input test name to inwer (#258)
Browse files Browse the repository at this point in the history
* Pass input test name to `inwer`

* Add tests

* Bump sioworkers version

* Fix input file name in job

* Fix interactive package test

* Fix makefiles
  • Loading branch information
MasloMaslane authored Nov 19, 2023
1 parent dd21a13 commit 951d083
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
Binary file modified oioioi/sinolpack/files/sinol-makefiles.tgz
Binary file not shown.
Binary file modified oioioi/sinolpack/files/test_interactive_package.tgz
Binary file not shown.
Binary file added oioioi/sinolpack/files/test_inwer_input_names.zip
Binary file not shown.
1 change: 1 addition & 0 deletions oioioi/sinolpack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ def _verify_inputs(self, tests):
job['task_priority'] = TASK_PRIORITY
job['exe_file'] = env['compiled_file']
job['in_file'] = django_to_filetracker_path(test.input_file)
job['in_file_name'] = self.short_name + test.name + '.in'
job['use_sandboxes'] = self.use_sandboxes
jobs[test.name] = job

Expand Down
24 changes: 24 additions & 0 deletions oioioi/sinolpack/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,30 @@ def test_inwer_failure_package(self):
# Bad packages need to be left over for the error messages
self.assertEqual(ProblemPackage.objects.count(), 1)

@both_configurations
def test_inwer_input_names(self):
ProblemInstance.objects.all().delete()

contest = Contest.objects.get()
filename = get_test_filename('test_inwer_input_names.zip')
self.assertTrue(self.client.login(username='test_admin'))
url = reverse('oioioiadmin:problems_problem_add')
response = self.client.get(url, {'contest_id': contest.id}, follow=True)
url = response.redirect_chain[-1][0]
self.assertEqual(response.status_code, 200)
response = self.client.post(
url,
{
'package_file': open(filename, 'rb'),
'visibility': Problem.VISIBILITY_PRIVATE,
},
follow=True,
)
self.assertEqual(response.status_code, 200)
self.assertEqual(Problem.objects.count(), 1)
self.assertEqual(ProblemInstance.objects.count(), 2)
self.assertEqual(ProblemPackage.objects.count(), 1)


class TestSinolPackageCreator(TestCase, TestStreamingMixin):
fixtures = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These dependencies need to be installed from external sources,
# therefore they must be listed here. Moreover, they cannot be listed in
# setup.py, as pip is not able to install them.
http://github.com/sio2project/sioworkers/archive/refs/tags/v1.4.2.tar.gz
http://github.com/sio2project/sioworkers/archive/refs/tags/v1.4.3.tar.gz

-e .

0 comments on commit 951d083

Please sign in to comment.