Skip to content

Commit 1ab5da5

Browse files
committed
Updated tmc-r-testrunner
1 parent 551a26a commit 1ab5da5

File tree

22 files changed

+742
-330
lines changed

22 files changed

+742
-330
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/tmc-langs-node/ts/generated.d.ts

Lines changed: 57 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
11
export interface StyleValidationResult {
22
strategy: StyleValidationStrategy;
3-
validationErrors: { [key: string]: StyleValidationError[] } | null;
3+
validation_errors: Record | null;
44
}
55

66
export interface StyleValidationError {
77
column: number;
88
line: number;
99
message: string;
10-
sourceName: string;
10+
source_name: string;
1111
}
1212

13-
export type StyleValidationStrategy = "FAIL" | "WARN" | "DISABLED";
13+
export type StyleValidationStrategy = "Fail" | "Warn" | "Disabled";
1414

1515
export interface ExercisePackagingConfiguration {
16-
student_file_paths: string[];
17-
exercise_file_paths: string[];
16+
student_file_paths: Array<unknown>;
17+
exercise_file_paths: Array<unknown>;
1818
}
1919

2020
export interface LocalExercise {
21-
"exercise-slug": string;
22-
"exercise-path": string;
21+
exercise_slug: string;
22+
exercise_path: unknown;
2323
}
2424

2525
export type OutputFormat = "Tar" | "Zip" | "TarZstd";
2626

2727
export interface RefreshData {
28-
"new-cache-path": string;
29-
"course-options": object;
30-
exercises: RefreshExercise[];
28+
new_cache_path: unknown;
29+
course_options: object;
30+
exercises: Array<RefreshExercise>;
3131
}
3232

3333
export interface RefreshExercise {
3434
name: string;
3535
checksum: string;
36-
points: string[];
37-
"sandbox-image": string;
38-
"tmcproject-yml": TmcProjectYml | null;
36+
points: Array<string>;
37+
path: unknown;
38+
sandbox_image: string;
39+
tmcproject_yml: TmcProjectYml | null;
3940
}
4041

4142
export interface TmcProjectYml {
42-
extra_student_files: string[] | null;
43-
extra_exercise_files: string[] | null;
44-
force_update: string[] | null;
43+
extra_student_files: Array<unknown>;
44+
extra_exercise_files: Array<unknown>;
45+
force_update: Array<unknown>;
4546
tests_timeout_ms: number | null;
4647
fail_on_valgrind_error: boolean | null;
4748
minimum_python_version: PythonVer | null;
@@ -56,70 +57,62 @@ export interface PythonVer {
5657

5758
export interface RunResult {
5859
status: RunStatus;
59-
testResults: TestResult[];
60-
logs: { [key: string]: string };
60+
test_results: Array<TestResult>;
61+
logs: Record<string, string>;
6162
}
6263

6364
export type RunStatus =
64-
| "PASSED"
65-
| "TESTS_FAILED"
66-
| "COMPILE_FAILED"
67-
| "TESTRUN_INTERRUPTED"
68-
| "GENERIC_ERROR";
65+
| "Passed"
66+
| "TestsFailed"
67+
| "CompileFailed"
68+
| "TestrunInterrupted"
69+
| "GenericError";
6970

7071
export interface TestResult {
7172
name: string;
7273
successful: boolean;
73-
points: string[];
74+
points: Array<string>;
7475
message: string;
75-
exception: string[];
76+
exception: Array<string>;
7677
}
7778

7879
export interface ExerciseDesc {
7980
name: string;
80-
tests: TestDesc[];
81+
tests: Array<TestDesc>;
8182
}
8283

8384
export interface TestDesc {
8485
name: string;
85-
points: string[];
86+
points: Array<string>;
8687
}
8788

8889
export interface UpdatedExercise {
8990
id: number;
9091
}
9192

9293
export interface DownloadOrUpdateCourseExercisesResult {
93-
downloaded: ExerciseDownload[];
94-
skipped: ExerciseDownload[];
95-
failed: [ExerciseDownload, string[]][] | null;
94+
downloaded: Array<ExerciseDownload>;
95+
skipped: Array<ExerciseDownload>;
96+
failed: Array | null;
9697
}
9798

9899
export interface ExerciseDownload {
99100
id: number;
100-
"course-slug": string;
101-
"exercise-slug": string;
102-
path: string;
101+
course_slug: string;
102+
exercise_slug: string;
103+
path: unknown;
103104
}
104105

105106
export interface CombinedCourseData {
106107
details: CourseDetails;
107-
exercises: CourseExercise[];
108+
exercises: Array<CourseExercise>;
108109
settings: CourseData;
109110
}
110111

111112
export interface CourseDetails {
112-
id: number;
113-
name: string;
114-
title: string;
115-
description: string | null;
116-
details_url: string;
117-
unlock_url: string;
118-
reviews_url: string;
119-
comet_url: string;
120-
spyware_urls: string[];
121-
unlockables: string[];
122-
exercises: Exercise[];
113+
course: Course;
114+
unlockables: Array<string>;
115+
exercises: Array<Exercise>;
123116
}
124117

125118
export interface Exercise {
@@ -140,7 +133,7 @@ export interface Exercise {
140133
reviewed: boolean;
141134
all_review_points_given: boolean;
142135
memory_limit: number | null;
143-
runtime_params: string[];
136+
runtime_params: Array<string>;
144137
valgrind_strategy: string;
145138
code_review_requests_enabled: boolean;
146139
run_tests_locally_action_enabled: boolean;
@@ -151,8 +144,8 @@ export interface Exercise {
151144

152145
export interface CourseExercise {
153146
id: number;
154-
available_points: ExercisePoint[];
155-
awarded_points: string[];
147+
available_points: Array<ExercisePoint>;
148+
awarded_points: Array<string>;
156149
name: string;
157150
publish_time: string | null;
158151
solution_visible_after: string | null;
@@ -202,7 +195,7 @@ export interface ExerciseDetails {
202195
exercise_id: number;
203196
unlocked_at: string | null;
204197
deadline: string | null;
205-
submissions: ExerciseSubmission[];
198+
submissions: Array<ExerciseSubmission>;
206199
}
207200

208201
export interface ExerciseSubmission {
@@ -248,8 +241,8 @@ export interface Submission {
248241
}
249242

250243
export interface UpdateResult {
251-
created: Exercise[];
252-
updated: Exercise[];
244+
created: Array<Exercise>;
245+
updated: Array<Exercise>;
253246
}
254247

255248
export interface Organization {
@@ -267,8 +260,8 @@ export interface Review {
267260
marked_as_read: boolean;
268261
reviewer_name: string;
269262
review_body: string;
270-
points: string[];
271-
points_not_awarded: string[];
263+
points: Array<string>;
264+
points_not_awarded: Array<string>;
272265
url: string;
273266
update_url: string;
274267
created_at: string;
@@ -287,11 +280,11 @@ export interface SubmissionFeedbackResponse {
287280
}
288281

289282
export type SubmissionStatus =
290-
| "processing"
291-
| "fail"
292-
| "ok"
293-
| "error"
294-
| "hidden";
283+
| "Processing"
284+
| "Fail"
285+
| "Ok"
286+
| "Error"
287+
| "Hidden";
295288

296289
export interface SubmissionFinished {
297290
api_version: number;
@@ -301,7 +294,7 @@ export interface SubmissionFinished {
301294
course: string;
302295
exercise_name: string;
303296
status: SubmissionStatus;
304-
points: string[];
297+
points: Array<string>;
305298
valgrind: string | null;
306299
submission_url: string;
307300
solution_url: string | null;
@@ -311,9 +304,9 @@ export interface SubmissionFinished {
311304
requests_review: boolean;
312305
paste_url: string | null;
313306
message_for_paste: string | null;
314-
missing_review_points: string[];
315-
test_cases: TestCase[] | null;
316-
feedback_questions: SubmissionFeedbackQuestion[] | null;
307+
missing_review_points: Array<string>;
308+
test_cases: Array | null;
309+
feedback_questions: Array | null;
317310
feedback_answer_url: string | null;
318311
error: string | null;
319312
validations: StyleValidationResult | null;
@@ -323,7 +316,7 @@ export interface TestCase {
323316
name: string;
324317
successful: boolean;
325318
message: string | null;
326-
exception: string[] | null;
319+
exception: Array | null;
327320
detailed_message: string | null;
328321
}
329322

@@ -339,5 +332,5 @@ export type SubmissionFeedbackKind = "Text" | {
339332
};
340333

341334
export interface TmcConfig {
342-
projects_dir: string;
335+
projects_dir: unknown;
343336
}

plugins/python3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The plugin creates a warning when the Python used is detected to be older than t
44

55
## Updating tmc-python-tester
66

7-
The tests use [tmc-python-tester](https://github.com/testmycode/tmc-python-tester) which should be updated occasionally by replacing `./tests/data/tmc` with the latest `./tmc` directory from the main branch of the repository. The update date should be written to `./tests/data/tmc_updated` to make it easier to see when it was last updated.
7+
The tests use [tmc-python-tester](https://github.com/testmycode/tmc-python-tester) which should be updated occasionally by replacing `./tests/data/tmc` with the latest `./tmc` directory from the main branch of the repository. When updating, update the `UPDATED` file to indicate when the update was done.
88

99
## Student file policy
1010

File renamed without changes.

plugins/r/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ All files inside `./R` are considered student files.
1414
./tests/test_file
1515
```
1616

17-
### Tests
17+
### Updating tmc-r-tester
1818

19-
The `tmcRtestrunner` library is included in `./tests` for easy installation during CI.
19+
The [tmcRtestrunner](https://github.com/testmycode/tmc-r-tester/) library is included in `./tests` for easy installation during CI. The library should be checked for updates occasionally. When updating, update the `UPDATED` file to indicate when the update was done.
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
Package: tmcRtestrunner
22
Type: Package
33
Title: Runs TMC R projects
4-
Version: 0.1.0
4+
Version: 0.2.7
55
Author: RTMC
6-
Maintainer: The package maintainer <yourself@somewhere.net>
6+
Maintainer: Petteri Piiroinen <petteri.piiroinen@gmail.com>
77
Description: More about what it does (maybe more than one line)
88
Use four spaces when indenting paragraphs within the Description.
99
License: What license is it under?
1010
Encoding: UTF-8
1111
LazyData: true
1212
Depends:
13-
testthat,
14-
jsonlite,
15-
R.utils
13+
testthat
1614
Imports:
17-
testthat,
1815
jsonlite,
1916
R.utils
20-
Suggests:
21-
lintr
2217
Collate:
2318
'ResultsJsonParser.R'
2419
'ResultsCreator.R'
2520
'RunTests.R'
2621
'GetAvailablePoints.R'
2722
'TestEnvironment.R'
23+
RoxygenNote: 7.1.1
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(file_encoding)
4+
export(run_available_points)
5+
export(run_tests)
16
exportPattern("^[[:alpha:]]+")
2-
import(testthat)
3-
import(jsonlite)
4-
import(R.utils)
7+
importFrom(R.utils,withTimeout)
8+
importFrom(jsonlite,prettify)
9+
importFrom(jsonlite,toJSON)
10+
importFrom(jsonlite,unbox)
11+
importFrom(testthat,test_file)
12+
importFrom(testthat,test_that)
13+
importFrom(utils,str)

0 commit comments

Comments
 (0)