Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Commits
5df7df2a
Commit
5df7df2a
authored
5 years ago
by
Dominik Seeger
Browse files
Options
Downloads
Patches
Plain Diff
tests are now created when importing via the frontend
parent
4cb7711c
No related branches found
No related tags found
No related merge requests found
Pipeline
#111129
failed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/models/feedback.py
+0
-20
0 additions, 20 deletions
core/models/feedback.py
util/importer.py
+3
-9
3 additions, 9 deletions
util/importer.py
with
3 additions
and
29 deletions
core/models/feedback.py
+
0
−
20
View file @
5df7df2a
...
...
@@ -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
"
...
...
This diff is collapsed.
Click to expand it.
util/importer.py
+
3
−
9
View file @
5df7df2a
...
...
@@ -34,19 +34,14 @@ RUSTY_HEKTOR_MAX_VER = "<5.0.0"
valid
=
{
"
yes
"
:
True
,
"
y
"
:
True
,
"
ye
"
:
True
,
"
no
"
:
False
,
"
n
"
:
False
}
ORIGIN_ORDER
=
{
Feedback
.
WAS_EMPTY
,
Feedback
.
DID_NOT_COMPILE
,
}
# the camel-case entries are here for the import via frontend functionality.
TEST_ORDER
=
(
'
EmptyTest
'
,
'
_empty_test
'
,
'
CompileTest
'
,
'
_compile_test
'
,
)
FEEDBACK_MAPPER
=
dict
(
zip
(
TEST_ORDER
,
ORIGIN_ORDER
))
user_factory
=
GradyUserFactory
()
...
...
@@ -199,7 +194,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
,
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment