Skip to content
Snippets Groups Projects
Commit 953f6806 authored by Dominik Seeger's avatar Dominik Seeger
Browse files

tests are now created, added editorcfg

parent 4cb7711c
No related branches found
No related tags found
1 merge request!196Resolve "Tests are not created when importing via frontend"
Pipeline #111142 canceled
......@@ -28,3 +28,10 @@ indent_style = tab
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
# Frontend
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
# Generated by Django 2.1.13 on 2019-10-12 15:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0021_merge_20190902_1246'),
]
operations = [
migrations.RemoveField(
model_name='feedback',
name='origin',
),
]
......@@ -41,26 +41,6 @@ class Feedback(models.Model):
# the denominators that are allowed for the decimal score interpreted as a fraction
ALLOWED_DENOMINATORS = [1, 2]
# how was this feedback created
(
WAS_EMPTY,
FAILED_UNIT_TESTS,
DID_NOT_COMPILE,
COULD_NOT_LINK,
MANUAL,
) = range(5)
ORIGIN = (
(WAS_EMPTY, 'was empty'),
(FAILED_UNIT_TESTS, 'passed unittests'),
(DID_NOT_COMPILE, 'did not compile'),
(COULD_NOT_LINK, 'could not link'),
(MANUAL, 'created by a human. yak!'),
)
origin = models.IntegerField(
choices=ORIGIN,
default=MANUAL,
)
class Meta:
verbose_name = "Feedback"
verbose_name_plural = "Feedback Set"
......
......@@ -6,7 +6,7 @@ from util.factories import GradyUserFactory
test_data = {
"meta": {
"version": "4.0.0"
"version": "5.0.0"
},
"module": {
"module_reference": "test",
......@@ -21,12 +21,12 @@ test_data = {
"submissions": [
{
"code": "some messy, perhaps incorrect stuff",
"tests": {},
"tests": [],
"type": "[a0] coding stuff"
},
{
"code": "i don't know man",
"tests": {},
"tests": [],
"type": "[a1] improvise"
}
],
......
{
"meta": {
"version": "4.0.0"
"version": "5.0.0"
},
"module": {
"module_reference": "B.Inf.1801",
......
......@@ -29,24 +29,11 @@ PASSWORDS = '.importer_passwords'
YES = 'Y/n'
NO = 'y/N'
RUSTY_HEKTOR_MIN_VER = ">=4.0.0"
RUSTY_HEKTOR_MAX_VER = "<5.0.0"
RUSTY_HEKTOR_MIN_VER = ">=5.0.0"
RUSTY_HEKTOR_MAX_VER = "<6.0.0"
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False}
ORIGIN_ORDER = {
Feedback.WAS_EMPTY,
Feedback.DID_NOT_COMPILE,
}
TEST_ORDER = (
'EmptyTest',
'CompileTest',
)
FEEDBACK_MAPPER = dict(zip(TEST_ORDER, ORIGIN_ORDER))
user_factory = GradyUserFactory()
......@@ -177,8 +164,7 @@ def add_tests(submission_obj, tests):
defaults={'is_active': False}
)
for name in (name for name in TEST_ORDER if name in tests):
test_data = tests[name]
for test_data in tests:
test_obj, created = Test.objects.update_or_create(
name=test_data['name'],
submission=submission_obj,
......@@ -199,7 +185,6 @@ def add_feedback_if_test_recommends_it(test_obj):
of_submission=test_obj.submission,
defaults={
'score': 0,
'origin': FEEDBACK_MAPPER[test_obj.name],
'is_final': True,
}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment