Skip to content

Commit f8d89ea

Browse files
authored
Merge pull request #619 from dodona-edu/files-features
Files features
2 parents bf4ae9a + c0a45fd commit f8d89ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4274
-401
lines changed

tested/configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Options:
6767
"""
6868

6969

70-
@fallback_field(get_converter(), {"testplan": "test_suite", "plan_name": "test_suite"})
70+
@fallback_field({"testplan": "test_suite", "plan_name": "test_suite"})
7171
@define
7272
class DodonaConfig:
7373
resources: Path

tested/dsl/schema-strict.json

Lines changed: 165 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,18 @@
276276
},
277277
"stdin" : {
278278
"description" : "Stdin for this context",
279-
"type" : [
280-
"string",
281-
"number",
282-
"integer",
283-
"boolean"
279+
"oneOf" : [
280+
{
281+
"type" : [
282+
"string",
283+
"number",
284+
"integer",
285+
"boolean"
286+
]
287+
},
288+
{
289+
"$ref": "#/definitions/fileData"
290+
}
284291
]
285292
},
286293
"arguments" : {
@@ -336,11 +343,18 @@
336343
]
337344
},
338345
"files" : {
346+
"description" : "Deprecated: use input_files instead.",
339347
"type" : "array",
340348
"items" : {
341349
"$ref" : "#/definitions/file"
342350
}
343351
},
352+
"input_files": {
353+
"type": "array",
354+
"items": {
355+
"$ref": "#/definitions/fileDataRequiredPath"
356+
}
357+
},
344358
"return" : {
345359
"description" : "Expected return value",
346360
"$ref" : "#/definitions/returnOutputChannel"
@@ -354,6 +368,10 @@
354368
"$ref" : "#/definitions/textOutputChannel"
355369
},
356370
"file": {
371+
"description" : "Deprecated: use output_files instead.",
372+
"$ref" : "#/definitions/fileOutputChannel"
373+
},
374+
"output_files": {
357375
"description" : "Expected files generated by the submission.",
358376
"$ref" : "#/definitions/fileOutputChannel"
359377
},
@@ -598,6 +616,35 @@
598616
}
599617
}
600618
},
619+
{
620+
"type" : "object",
621+
"description" : "Built-in oracle for files.",
622+
"required" : [
623+
"data"
624+
],
625+
"properties" : {
626+
"data" : {
627+
"type" : "array",
628+
"description" : "Files to expect.",
629+
"items" : {
630+
"$ref" : "#/definitions/fileDataFullyRequired"
631+
}
632+
},
633+
"oracle" : {
634+
"const" : "builtin"
635+
},
636+
"config" : {
637+
"$ref" : "#/definitions/fileConfigurationOptions"
638+
}
639+
}
640+
},
641+
{
642+
"type" : "array",
643+
"description" : "Built-in oracle for files.",
644+
"items" : {
645+
"$ref" : "#/definitions/fileDataFullyRequired"
646+
}
647+
},
601648
{
602649
"type" : "object",
603650
"description" : "Custom oracle for file values.",
@@ -643,6 +690,49 @@
643690
}
644691
}
645692
}
693+
},
694+
{
695+
"type" : "object",
696+
"description" : "Custom oracle for file values.",
697+
"required" : [
698+
"oracle",
699+
"data"
700+
],
701+
"properties" : {
702+
"oracle" : {
703+
"const" : "custom_check"
704+
},
705+
"data" : {
706+
"type" : "array",
707+
"description" : "Files to expect.",
708+
"items" : {
709+
"$ref" : "#/definitions/fileDataFullyRequired"
710+
}
711+
},
712+
"file" : {
713+
"type" : "string",
714+
"description" : "The path to the file containing the custom check function."
715+
},
716+
"name" : {
717+
"type" : "string",
718+
"description" : "The name of the custom check function.",
719+
"default" : "evaluate"
720+
},
721+
"arguments" : {
722+
"type" : "array",
723+
"description" : "List of YAML (or tagged expression) values to use as arguments to the function.",
724+
"items" : {
725+
"$ref" : "#/definitions/yamlValueOrPythonExpression"
726+
}
727+
},
728+
"languages": {
729+
"type" : "array",
730+
"description" : "Which programming languages are supported by this oracle.",
731+
"items" : {
732+
"$ref" : "#/definitions/programmingLanguage"
733+
}
734+
}
735+
}
646736
}
647737
]
648738
},
@@ -890,6 +980,76 @@
890980
"$ref" : "#/definitions/fileConfigurationOptions"
891981
}
892982
}
983+
},
984+
"fileData": {
985+
"type": "object",
986+
"additionalProperties" : false,
987+
"anyOf" : [
988+
{
989+
"required" : [
990+
"content"
991+
]
992+
},
993+
{
994+
"required" : [
995+
"path"
996+
]
997+
}
998+
],
999+
"properties": {
1000+
"content": {
1001+
"type": [
1002+
"string",
1003+
"path"
1004+
],
1005+
"description" : "Content of the file, which will be provided inline or written to disk in the workdir. If a !path, the file contents will be read from the provided path."
1006+
},
1007+
"path": {
1008+
"type": "string",
1009+
"description" : "Path to the file, relative to the workdir. Used to display in the output."
1010+
}
1011+
}
1012+
},
1013+
"fileDataRequiredPath": {
1014+
"type": "object",
1015+
"additionalProperties" : false,
1016+
"required" : [
1017+
"path"
1018+
],
1019+
"properties": {
1020+
"content": {
1021+
"type": [
1022+
"string",
1023+
"path"
1024+
],
1025+
"description" : "Content of the file, which will be provided inline or written to disk in the workdir. If a !path, the file contents will be read from the provided path."
1026+
},
1027+
"path": {
1028+
"type": "string",
1029+
"description" : "Path to the file, relative to the workdir. Used to display in the output."
1030+
}
1031+
}
1032+
},
1033+
"fileDataFullyRequired": {
1034+
"type": "object",
1035+
"additionalProperties" : false,
1036+
"required" : [
1037+
"path",
1038+
"content"
1039+
],
1040+
"properties": {
1041+
"content": {
1042+
"type": [
1043+
"string",
1044+
"path"
1045+
],
1046+
"description" : "Content of the file, which will be provided inline or written to disk in the workdir. If a !path, the file contents will be read from the provided path."
1047+
},
1048+
"path": {
1049+
"type": "string",
1050+
"description" : "Path to the file, relative to the workdir. Used to display in the output."
1051+
}
1052+
}
8931053
}
8941054
}
8951055
}

0 commit comments

Comments
 (0)