Open kingraphaii opened 10 months ago
At this point the lib prioritizes tester.register_command_description()
, if thats not set it checks the adapter confs. In summary:
tester.register_command_description()
in tests, no need to put the description tag in adapter.tester.register_command_description()
only when it's set, otherwise we expect the config to have the tag.For your case, I'm assuming you had neither <command_description>
nor tester.register_command_description()
in the tests?
I did push another commit to safely check for command_description
on the test runner itself, but it's a different issue I addressed than what you encountered.
I have this one in the functional tests:
# automarker-2-config/coding_aptitude_mini_course_task1_756/functional_tests/test_task_1.py
import importlib
import adapter.adapter as adapter
importlib.reload(adapter)
from adapter.adapter import task1
def test_runs_correctly(tester):
command = task1()
tester.run_command(command, assert_no_import_side_effects=False)
tester.register_command_description("call task1 :)")
tester.assert_returned(None)
tester.assert_printed("Hello World!")
In adapter:
// /automarker-2-config/coding_aptitude_mini_course_task1_756/javascript/adapter/task1.js
console.log("<setup>");
console.log("</setup>");
// console.log("<command_description>");
// console.log("call task1");
// console.log("</command_description>");
console.log("<import_learner_code>");
const { task1 } = require("../../task1");
console.log("</import_learner_code>");
console.log("<running>");
const result = task1();
console.log("</running>");
console.log("<returned>");
console.log(JSON.stringify(result));
console.log("</returned>");
Does it matter where you define it in the functional tests?
Oh, yeah. I see where the issue is, should have documented it better. We register description before running command :)
That makes sense in hindsight.
Related issues: N/A
Description:
New automarker lib setup will require or allow configs to set command description within functional tests, no need for repeating it in adapters for each flavour :)
Example usage:
But...
Setting command description in adapters allowed us to describe how certain functions were called, according to what we expected from each language.
JS ex.
Python ex.
if..else
blocks won't look good here, still thinking of a cleaner way we can use, or is something like the following pseudo desc. acceptable?:Screenshots/videos
N/A
I solemnly swear that: