cyber-dojo start-points manifest.json entries explained

Example: the manifest.json file for Java/JUnit currently looks like this:

{ "display_name": "Java, JUnit", "visible_filenames": [ "", "", "" ], "image_name": "cyberdojofoundation/java_junit", "filename_extension": ".java", "tab_size": 4, "progress_regexs" : [ "Tests run\\: (\\d)+,(\\s)+Failures\\: (\\d)+", "OK \\((\\d)+ test(s)?\\)" ] }

Required entries

"display_name": string

The name as it appears in the start-point setup pages where you select your language-plus-test-framework. For example, "Java, JUnit" means that "Java, JUnit" will appear as a selectable entry. A single string with the major name first, then a comma, then the minor name.

"visible_filenames": [ string, string, ... ]

Filenames that will be visible in the browser's editor when an animal initially enter's a cyber-dojo. Each of these files must be a plain text file and exist in the manifest.json's directory. Filenames can be in nested sub-directories, eg "tests/". Must include This is because is the name of the shell file assumed by the runner to be the start point for running the tests. You can write any actions inside but clearly any programs it tries to run must be installed in the docker image_name. For example, if runs gcc to compile C files then gcc has to be installed. If runs javac to compile java files then javac has to be installed.

"image_name": string

The name of the docker image used to run a container in which is executed. Do not include any version numbers (eg of the compiler or test-framework). The docker image must contain a file called red_amber_green.rb in the /usr/local/bin directory. The ragger service uses this to determine the traffic-light colour of each test run outcome. For example, here's the one for Java-JUnit.

"filename_extension": [ string, string, ... ]

The extensions of filenames that identify source files which are listed above the output file(s) in the filename list. The first entry is also used when creating a new filename. For example, if set to ".java" the new filename will be If you only have a single filename extension you can use a single string instead of an array containing a single string.

Optional entries

"max_seconds": int

The maximum number of seconds has to complete the tests.
An integer between 1 and 20.
Defaults to 10.

"tab_size": int

The number of spaces a tab character expands to in the browser's textarea editor.
An integer between 1 and 12.
Defaults to 4.

"hidden_filenames": [ string, string, ... ]

When the runner runs, it it often creates files. All text-files created under /sandbox are returned to the browser unless their name matches any of these string regexs.
An array of strings used to create Ruby regexs, used by cyber-dojo, like this For example, to hide files ending in .d you can use the following string ".*\\.d"
Defaults to [ ].

"progress_regexs": [ string, string ]

Used on the dashboard to show the test output line (which often contains the number of passing and failing tests) of each animal's most recent red/green traffic light. Useful when your practice session starts from a large number of pre-written tests and you wish to monitor the progress of each animal.
An array of two strings used to create Ruby regexs. The first one to match a red traffic light's test output, and the second one to match a green traffic light's test output.
Defaults to [ ].

"highlight_filenames": [ string, string, ... ]

Filenames whose appearance is highlighted in the browser. This can be useful if you have many "visible_filenames" and want to mark which files form the focus of the practice.
An array of strings. A strict subset of "visible_filenames".
Defaults to [ ].

No comments:

Post a Comment